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"
More on Release Engineering and Progressive Delivery
How do you do zero-downtime deployments on Kubernetes?IntermediateHow do you implement a canary release with Argo Rollouts and automated analysis?AdvancedHow do you roll back safely when a deploy includes a database migration?AdvancedHow do you design an automated rollback trigger?AdvancedHow do you handle hotfixes in a trunk-based flow?IntermediateHow do you version and release libraries versus services?Intermediate