Why it matters
Continuous delivery exists to make the cost of a change small and the evidence about it reliable. The two failure modes are a pipeline that tests something other than what ships, and a pipeline so slow that changes batch up and the first real test is production. Both are fixed by the same discipline: one artefact, fast deterministic checks, and a promotion path that can be reversed.
Mental model
It is a factory line with an inspection station at each step: the same item moves through, and each station can stop the line. The analogy breaks because software can be duplicated, so promoting one artefact rather than rebuilding it is a choice, not a physical constraint.
How it works
- 1Trigger on every push to the shared branch, and make the pipeline the only path to production.
- 2Build one immutable artefact, tag it with the commit, and promote that artefact through environments.
- 3Order checks by speed: static analysis, unit tests, integration tests, then a small end-to-end set.
- 4Run migrations as a separate, backward-compatible step so old and new application versions can coexist.
- 5Gate promotion on the checks that predict production failure, and keep a manual approval only where human judgement is required.
- 6Automate rollback to the previous artefact and rehearse it, including the database state.
Step 1 of 6
Trigger on every push to the shared branch, and make the pipeline the only path to production.
Figure. The mechanism in this page's own steps. The figure adds sequence, not new claims.
What to notice. A step can be read alone, but the order is the mechanism. The control lets you stop on any one.
Text version
The page's steps: 1. Trigger on every push to the shared branch, and make the pipeline the only path to produc… 2. Build one immutable artefact, tag it with the commit, and promote that artefact through e… 3. Order checks by speed: static analysis, unit tests, integration tests, then a small end-t… 4. Run migrations as a separate, backward-compatible step so old and new application version… 5. Gate promotion on the checks that predict production failure, and keep a manual approval … 6. Automate rollback to the previous artefact and rehearse it, including the database state.
- Trigger on every push to the shared branch, and make the pipeline the only path to production.
- Build one immutable artefact, tag it with the commit, and promote that artefact through environments.
- Order checks by speed: static analysis, unit tests, integration tests, then a small end-to-end set.
- Run migrations as a separate, backward-compatible step so old and new application versions can coexist.
- Gate promotion on the checks that predict production failure, and keep a manual approval only where human judgement is required.
- Automate rollback to the previous artefact and rehearse it, including the database state.
Trade-offs
| Choice | Good for | Cost | Fails when |
|---|---|---|---|
| Trunk-based development | Small changes and fast integration | Requires feature flags and discipline | The team cannot keep the branch green |
| Long-lived branches | Isolation for large changes | Merge pain and late integration | Releases are frequent |
| Full end-to-end suite per commit | High confidence | Slow and flaky | The suite takes longer than the review cycle |
| Manual promotion | Human judgement on risk | Delay and inconsistent gates | Releases are routine |
Good for
Small changes and fast integration
Cost
Requires feature flags and discipline
Fails when
The team cannot keep the branch green
- The team cannot keep the branch green
- Releases are frequent
- The suite takes longer than the review cycle
- Releases are routine
Figure. Each choice with what it buys, what it costs, and the case where it loses.
What to notice. The fourth column is the decision: if the losing case describes your situation, the choice is wrong.
Text version
Four trade-offs: Trunk-based development is good for Small changes and fast integration, costs Requires feature flags and discipline, and fails when The team cannot keep the branch green. Long-lived branches is good for Isolation for large changes, costs Merge pain and late integration, and fails when Releases are frequent. Full end-to-end suite per commit is good for High confidence, costs Slow and flaky, and fails when The suite takes longer than the review cycle. Manual promotion is good for Human judgement on risk, costs Delay and inconsistent gates, and fails when Releases are routine
Failure modes
- Rebuild per environment. The deployed artefact differs from the tested one because dependencies resolved differently. Debug: compare artefact digests between staging and production for the same release.
- Flaky gate. The suite fails intermittently and engineers rerun until green. Debug: track pass rate per test over a week and quarantine anything below a stable threshold.
- Migration without compatibility. The old application version breaks when the new schema is applied. Debug: deploy the migration first and run the previous application version against it in staging.
In production
Track pipeline duration, flake rate and time from merge to production; these predict how often changes are batched. Alert on a rising rollback rate, which usually means the gate is not testing what breaks.
Common misconceptions
People think: Integration means running tests somewhere other than your laptop.
Actually: It means every change is integrated into a shared branch and verified there, which is a workflow property, not a server.
People think: More pipeline stages mean more safety.
Actually: Stages add delay and failure surface; safety comes from the checks that predict real failures and from a fast rollback.
Interview angle
Cover build once, artefact promotion, the ordering of checks and a backward-compatible migration. Name the rollback rehearsal. A list of stages, with no account of what makes the deployed thing identical to the tested thing, is incomplete.
Sources
- Martin Fowler, Continuous Integration — the practice and its preconditions.
- GitHub Actions documentation — pipeline definition, artefacts and environments.
- DORA, Research program — delivery metrics and what predicts performance.