CI/CD
Let a robot do the deploy at 3am. Robots don’t panic.
▶ the lesson · narrated sketch video · tap for sound
the intro
CI runs your tests automatically on every push. CD takes green code and deploys it. Together they turn deploys from a scary ritual into a non-event: small changes, tested automatically, shipped the same way every time.
fun fact ✦
CI’s first job is emotional: it turns “did I break prod?” into “the robot says no”.
the docs
the deep dive
the ideas behind the video — concepts, diagrams, a walkthrough and the traps to avoid
Humans are wonderful at judgment and terrible at running the same twelve-step checklist identically at 3am. A pipeline is that checklist handed to a robot that never gets tired or cocky. The real payoff is not even the automation — it is feedback speed: you learn in three minutes that a push broke something, not in three weeks when a customer finds it.
small changes, caught small
key terms
pipeline
The whole checklist a push triggers — install, test, build, deploy — defined as code in the repo itself.
.github/workflows/ci.ymlrunner
The disposable machine that executes your pipeline. Ephemeral by design: clean every run, no leftovers.
an ubuntu-latest VMartifact
The build output a passing stage hands to the next one — a bundle, a Docker image, a dist folder.
dist/ or myapp:sha-abc123green build
Every stage passed. Main stays green at all times, and only green code earns a deploy.
a red X blocks the mergehow it works
- 1Push your branch
The push event is the trigger. The pipeline definition lives in the repo as YAML, versioned right next to the code it guards.
- 2Runner checks out
A clean, disposable machine grabs the code and installs dependencies from cache — seconds, not minutes.
- 3Tests gate everything
Lint, unit tests, maybe a build. Red stops the line here, so a broken push never gets closer to production than this.
- 4Build the artifact
Green code is compiled into exactly one thing — a bundle or image — that every later stage uses, so what you tested is what ships.
- 5Deploy on green only
Only a passing main, or a version tag, reaches production. Rollback is just redeploying the previous tag.
the code, explained
a pipeline in eight lines of YAML
side by side
deploy by hand
- relies on 3am adrenaline
- steps live in someone's head
- skipped step, mystery bug
- rollback is archaeology
deploy by pipeline
- same checklist every time
- every change gets tested
- red builds never ship
- rollback is the last tag
A test that fails randomly is worse than no test: people start re-running the pipeline until it is green, and that reflex eventually clicks for the real failures too. Quarantine flaky tests the day they appear and fix them fast — trust in the robot is the whole product.
quick answers
CI versus CD — what is the difference?
CI builds and tests every push. CD deploys whatever passed: continuous delivery stops at a ready artifact waiting for a human, continuous deployment ships it live with no human at all.
How long should a pipeline take?
Under ten minutes is the goal. Past that, people start batching changes, which quietly kills everything CI is for. Cache installs and split jobs to stay fast.
Do I need CI on a solo project?
More than on a team: your future self is the stranger who broke the build, and the pipeline is how past-you leaves a note.
quick hits about CI/CD
short answers · interviews, tips, trivia & hidden gems