Goal
Build pipelines that developers trust: fast feedback and stable results.
Key principles
- fail fast (lint/unit tests early)
- deterministic builds (pin versions)
- cache smart (dependencies)
- keep stages small and clear
- avoid flaky tests (quarantine or fix)
Caching (example)
In GitHub Actions:
- cache node_modules or npm cache
- cache build outputs if safe
Artifacts
Build once, deploy many.
- create Docker image once
- promote the same image across environments
Guardrails
Add gradually:
- required checks on main
- protected environments
- manual approval for production
- rollbacks and health checks
Exercise
Design a pipeline for your app with these stages:
- lint + typecheck
- test
- build
- docker build + push
- deploy staging
- deploy prod (manual approval)
Next Step
Implement it in GitHub Actions with a production-grade workflow.