Promoting one tested artifact keeps deployment tied to the validated content. Rebuilding separately for each environment can introduce variation.
Before you start
You should understand commits, branches, the working tree and the staging area. Draw the commit graph before changing history. Try commands in a disposable repository with a clean working tree so you can observe exactly which references and files each operation changes.
The practical goal is to reason through this situation: A release digest tested in staging is the same digest deployed to production. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Identify the tested artifact
Record its digest and source revision.
Step 2: Separate runtime settings
Environment configuration should not silently create another binary where avoidable.
Step 3: Promote the same content
Deploy the artifact that passed staging validation.
Worked scenario
A release digest tested in staging is the same digest deployed to production.
Staging tests image digest A, but production rebuilds the same source with changed dependency resolution and produces B. The staging evidence no longer applies to the exact deployed bytes. Promoting A keeps artifact identity consistent while still validating production runtime settings and external dependencies.
Common mistake
Environment-dependent builds can quietly create a different production binary.
Verify the behavior
Compare artifact digests across stages and record the configuration accompanying each deployment.
Interview exercise
Handle environment configuration.
Answer and reasoning
Separate runtime configuration where appropriate and record the exact artifact and configuration used in each deployment.
Continue learning
Compare the scenario with the Git and CI/CD interview questions and test your understanding with the Git and CI/CD MCQs. For terminology and implementation details, consult the reference material.