- CI/CD
- continuous integration
- continuous deployment
- pipeline
- automated tests
- deploy gate
- GitHub Actions
CI/CD — The Robot That Lets You Ship Fearlessly 🏭
How does a company deploy hundreds of times a day without constantly breaking? They don't trust humans to remember to run the tests. A robot runs them automatically on every single push, and blocks anything that fails. That robot is CI/CD.
🧠 The mental model: a factory assembly line with quality gates
Your change moves down a line. At each station it's inspected. A part that fails inspection never reaches the customer.
Every gate must pass before the next runs — one red gate and nothing deploys.
- ›CI — Continuous Integration: every push is automatically linted, tested, built. Broken code is caught in minutes, not by a user in production.
- ›CD — Continuous Delivery/Deployment: if all gates are green, the change is shipped automatically (or with one click).
If any gate goes red, the line stops and nothing deploys. That safety net is exactly what lets teams move fast — you can't break prod if broken code can't reach it.
What it looks like (GitHub Actions)
yaml# .github/workflows/ci.yml on: [push] # run on every push jobs: verify: steps: - run: npm ci # install - run: npm run lint # style / dead code - run: npm test # correctness - run: npm run build # does it even compile?
This is real and it's yours: EcoFinLearn has exactly this file. On every push it runs type-check → lint → tests → build. That is CI standing guard over
mainso a bad commit never ships.
A pro habit: order gates cheapest-first
Put the 2-second linter before the 10-minute test suite, so the pipeline rejects obviously-broken code in seconds instead of making you wait. Fail fast, fail cheap.
🔧 Try it for real
Open .github/workflows/ci.yml in any repo you have (EcoFinLearn included). Read the steps top to bottom — that's the literal recipe that runs on every push. Push a commit and watch the checkmarks appear on GitHub.
Your Task
Model a pipeline as (stage, passed) steps. Print each result, and only allow the deploy if every stage passed. (Then flip one stage to False and re-run — watch the deploy get blocked.)