I'm working on a CI/CD setup that involves three environments: development (dev), staging (stage), and production (prod). In Git, I have a main branch for production, along with stage and dev branches for their respective environments. The workflow starts with creating a feature branch from main, such as feature/test. After development, I push my changes, create a pull request (PR), and then merge into the target branch. For each branch, images are built and pushed to the GitHub registry with a prefixed naming convention: dev-servicename:commithash for dev, stage-servicename:commithash for stage, and no prefix for the main branch. Additionally, I have a separate repository for Kubernetes manifests organized into folders for each environment. ArgoCD manages the updates to the cluster. Does this structure make sense for handling multiple environments and facilitating automated deployments? I'd appreciate any suggestions for improvement!
5 Answers
Your setup sounds solid and is quite commonly used. While I prefer Flux for similar tasks, using ArgoCD is perfectly fine. Go ahead with it!
Your setup looks robust, but debugging environment-specific issues can become a hassle. You might want to explore tools like runnable.io for spinning up isolated runs when bugs pop up.
I keep infrastructure in its own repository, and all changes go directly into the main branch. In my experience, long-lived branches can get tricky, but that's just my perspective!
Nice work with the mindset you have! I'd suggest starting feature branches from main and merging PRs back into it, which would trigger your CI/CD for dev first and then automating promotions. A streamlined tagging scheme can also save you a lot of headaches later, reducing unnecessary rebuilds!
You might consider maintaining separate repositories for each environment that sync with ArgoCD. Creating your own umbrella helm charts in a different repository can help manage versioned packages effectively. This way, you detach your infrastructure, configurations, charts, and images for each cluster/environment flexibly, possibly using semver tagging for tracking overall cluster versions.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically