Interview Prep/CI/CD/GitHub Actions

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 →

  1. Build and push app:<sha> once, record the digest as a job output.
  2. Deploy jobs for dev, staging, prod use needs, each targeting an environment: and deploy app@sha256:....
  3. 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.

All CI/CD questions

More on GitHub Actions