How do you implement a multi-environment deployment pipeline (dev → staging → prod)?
A professional multi-environment pipeline uses gates between stages:
- Build once: A single immutable artifact (Docker image with SHA tag) is promoted — never rebuilt.
- Deploy to Dev: Automatic on every merge to main.
- Deploy to Staging: Automatic after dev health checks pass. Run integration and smoke tests.
- Deploy to Prod: Manual approval gate + scheduled deployment window.
The key is that the same image moves through all environments. This ensures what you tested in staging is exactly what runs in production.