Interview Prep/CI/CD/Release Engineering and Progressive Delivery

How do you ensure that the same artifact is promoted and not rebuilt?

BeginnerProductionRelease Engineering and Progressive Delivery
Answer

Promote by digest. The build job outputs the image digest, and every later job and the GitOps pin references image@sha256:.... Staging and production jobs verify the digest equals the one signed and tested. Do not run docker build in deploy jobs, and make registries reject tag overwrites.

DIGEST=$(docker buildx imagetools inspect ghcr.io/acme/shop-api:$GIT_SHA --format '{{json .Manifest.Digest}}' | tr -d '"')
echo "image=ghcr.io/acme/shop-api@${DIGEST}" >> "$GITHUB_OUTPUT"
All CI/CD questions Roadmap: CI/CD fundamentals

More on Release Engineering and Progressive Delivery