8.2 Pipeline stages — lint → test → build → push → deploy
A typical beginner-friendly path for an API image:
commit / PR
│
▼
lint / format check ← fail fast, cheap
│
▼
unit / integration tests
│
▼
build artifact (container image / zip)
│
▼
push to registry (GHCR / Docker Hub…)
│
▼
deploy to staging
│
▼
(optional) manual approval
│
▼
deploy to production
| Stage | Question it answers |
|---|---|
| Lint | Is the code style / basic static check OK? |
| Test | Do automated checks pass? |
| Build | Can we produce a runnable artifact? |
| Push | Is the artifact stored with a clear tag? |
| Deploy | Is that exact artifact running in an environment? |
Tiny example. Developer opens a PR that adds GET /health. CI runs lint + tests. On merge to main, CI builds badge-api:a3f2c1 and pushes it. Staging pulls that tag. After a smoke check, production pulls the same tag.
Ravindra Bagale's Tip
Khup students staging var latest aani prod var dusra mystery build use kartat. Same git SHA / image tag promote kara — "works in staging" tar tohach bit promote. Dhyan rakho!