A useful CI/CD pipeline should identify the build being released, show which checks passed and provide a way to recover if the release fails. Start with the smallest pipeline that demonstrates those properties for your product. Adding more jobs without deciding what blocks a release can make the process slower without making it clearer.
Build once, verify that artifact, then promote it
For a static web release, create the production files, run the appropriate checks and publish them to a preview environment. Verify the pages and assets that matter, then promote the same artifact. Rebuilding after verification can introduce a different dependency resolution or configuration. Record the commit and artifact identity so a later incident can be tied to the release.
AptixLabs uses this distinction in its own website workflow: a Vite build produces prerendered pages, a sitemap and article chunks. Browser checks inspect readable content without JavaScript, metadata, links and hydration. Those are checks for this site’s failure modes; a mobile app or transactional API needs a different acceptance set.
| Gate | Evidence before release | Recovery question |
|---|---|---|
| Source and build | Known commit, dependency lockfile and successful compilation | Can the previous artifact still be deployed? |
| Product behavior | Core task and meaningful failure paths pass | Can an operator detect a failed task? |
| Database change | Old and new clients remain compatible during rollout | Would rolling back code leave an incompatible schema? |
| Hosting | Required routes and hashed assets resolve from the preview | Can the same files be promoted without rebuilding? |
| Measurement | Production events work; preview visits are excluded | Will validation pollute customer reports? |
Separate code rollback from data recovery
Returning to yesterday’s application does not undo a destructive migration or an external payment. Prefer changes that allow old and new versions to coexist during rollout. Back up and rehearse recovery where data loss is possible. For an irreversible operation, write the compensating or support procedure before calling the release reversible.
Keep secrets and approval rules tied to the environment
GitHub Actions environments can control deployment access and protection rules. Choose rules that fit the repository and available plan, and verify the branch and secret boundaries. A preview should use the intended test dependencies rather than accidentally writing customer records or sending real notifications.
GitHub: deployment environments
Rehearse one failed release
- Deploy a harmless failing candidate to a test environment.
- Confirm the check that should reject it actually fails.
- Restore the previous verified artifact using the runbook.
- Verify the core user task and record the operator’s missing instructions.
Progressive feature-flag rollout and rollback
Mobile app releases need runtime and API compatibility
Is redeploying the old code a complete rollback plan?
Only when the old code remains compatible with current data and dependencies. Database changes, queued work and external actions need their own recovery or compensation plan.
What should a small team automate first?
Automate the checks that identify a broken build or failed core task, then verify the exact artifact and its deployment environment. Add checks when a real failure mode justifies them.
