Build a Multi-Stage Deployment Pipeline
Extend a CI workflow into a full pipeline — build, test, containerize, and deploy across environments — using job dependencies and GitHub Environments as promotion gates.
Prerequisites: completed CI Pipeline Fundamentals, a Docker Hub or GHCR account, basic Docker familiarity.
Sourcing & version notes: verified against current docs as of July 2026 — docker/build-push-action@v6, docker/setup-buildx-action@v3, docker/metadata-action@v5, actions/upload-artifact@v7 are the current majors. GitHub Environments with required reviewers is a stable, unchanged GA feature used here for the promotion gate.
A CI pipeline proves your code works; a deployment pipeline gets it running somewhere. This project chains build → test → containerize → deploy-to-staging → deploy-to-production as ordered stages, with an explicit human approval gate between staging and production — the shape almost every real-world pipeline takes, whether the destination is Kubernetes, a VM fleet, or a PaaS.
Step 1 — Model stages as dependent jobs
Step 2 — Build and push a container image
Step 3 — Deploy to staging automatically
Step 4 — Gate production behind a human approval
Secret Mission: add a rollback job
Before You Go
Test what you just learned
Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.
Log in to unlock0 / 7 complete
