Interview Prep/Git & GitHub/Branching and workflow design

How do you design the release process so that any production artifact is traceable to a commit?

AdvancedProductionBranching and workflow design
Answer

Build once per commit, tag the image with the Git SHA, embed git describe output and SHA in the binary and as OCI labels, and promote the same digest through environments. Release notes and the deploy record link tag, PR numbers and digest. During an incident the question "what is running?" becomes a one-command answer.

docker build -t app:${GITHUB_SHA} \
  --label org.opencontainers.image.revision=${GITHUB_SHA} \
  --label org.opencontainers.image.source=https://github.com/org/app .
All Git & GitHub questions Roadmap: Git & GitHub

More on Branching and workflow design