Monorepo with multiple environments; you want the same image promoted dev → staging → prod.
IntermediateScenarioGitHub Actions
Answer
Situation read → Build once, promote.
What I'd do →
- Build and push
app:<sha>once, record the digest as a job output. - Deploy jobs for
dev,staging,produseneeds, each targeting anenvironment:and deployapp@sha256:.... - Config differences come from per-environment values, not from rebuilding.
Why → What you tested is exactly what you ship.
Interview tip → Deploy by digest, not mutable tag.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate