CI/CD and deployment
Pipeline (runs on every PR and on main)
Section titled “Pipeline (runs on every PR and on main)”Stages in this order, failing fast:
- Install from lockfile
- Format and lint
- Type check
- Unit tests
- Content/data validation (schemas, references)
- Build
- Link check on the build output
- Integration and end-to-end tests with accessibility checks
- Performance budgets (Lighthouse CI, bundle size)
- Dependency audit
- A red pipeline blocks merge. No “merge and fix later”.
- Pipeline duration SHOULD stay under about 10 minutes for PRs; move slow suites to nightly if needed.
Environments
Section titled “Environments”- At least: local, preview (per PR), production. Add staging when there is a database or integrations worth testing before production.
- Each environment has its own secrets and credentials. Previews never use production data or production analytics IDs.
- Preview URLs SHOULD be
noindexand not publicly linked.
Secrets in CI
Section titled “Secrets in CI”- Stored in the CI or hosting platform’s secret store, scoped to the environments that need them.
- Never echoed in logs; masked by the platform.
Releases
Section titled “Releases”- Production deploys come only from
main(or release tags) through CI, never from a laptop. - Every release is tagged and has a changelog entry.
- Database migrations run as an explicit, reviewed step before or with the release, following the data rules.
Rollback
Section titled “Rollback”- Every deploy can be rolled back in minutes (platform rollback or redeploy of the previous tag). Test the rollback once before launch.
- Migrations that cannot be rolled back are called out in the PR with a recovery plan.
After deploy
Section titled “After deploy”- Smoke check the key pages or endpoints automatically.
- Watch error rate and latency for the first hour after significant releases.
Checklist
Section titled “Checklist”- Pipeline stages in order; red blocks merge
- Preview per PR, noindex, no production data
- Secrets per environment
- Tagged releases with changelog
- Rollback tested
- Post-deploy smoke check