CI/CD tutorial
See what happens after you push. Build pipelines that test, ship and roll back safely, in a pipeline lab in your browser.
Course contents
Start Here
- What Happens After You Push — What a CI/CD pipeline does after you push: the nine stops from push to production, the parts of a run (trigger, runner, job, step, log), and how to find the one log line that explains a red build.
- Builds, Artifacts and Environments — What a build makes, why the pipeline saves it as a named artifact, and how dev, staging and production differ. The three words every later lesson uses.
Continuous Integration
- Your First Pipeline — Write a pipeline file yourself: triggers for push, pull request, schedule and manual runs, the setup step for the right version, and jobs that run in order on fresh runners.
- Reading Red Builds — Read a failed run in five steps and fix the failures you meet at work: wrong tool version, a missing setting, a missing install, a time limit and a lint rule. Tell flaky tests from broken ones.
- Quality Gates on Pull Requests — Add lint, type check and test gates, give each its own job, lock the merge button with branch protection, and stop AI agent pull requests from hiding failures.
- Tests and Workflow Logic — Show test failures on the pull request, run tests against a real database, pass values between jobs, and skip runs for docs-only changes.
- Faster Pipelines — Take a pipeline from about 11 minutes to under 5 with the same checks: cache packages, run checks as parallel jobs, test several versions with a matrix and cancel stale runs.
- Artifacts and Versions — Save the build output as a versioned artifact, pass it to the next job, and deploy the same tested artifact to staging and production. Never rebuild after tests.
- Containers in CI — Write a small multi-stage Dockerfile, build and push the image from the pipeline, tag it with the commit, cache layers, scan it with Trivy, and record where it came from.
- Pipeline Security — Close four attack paths in GitHub Actions: pin actions to commit SHAs, use a read-only token, keep fork code away from secrets, and stop checkout leaving the token on disk. With the Azure Pipelines equivalents.
Continuous Delivery
- Environments and Secrets — Deploy through environments with approval rules, keep secrets in the platform, sign in to Azure with OIDC instead of a stored password, and deploy to production only from main after staging.
- Deploy for Real — Set up Azure App Service once, sign in without passwords, deploy the pushed image, fix wrong app names, and send production only on a published release.
- Deploy and Smoke Test — Add a deploy job, check the live app with a smoke test on its health page, retry for slow starts, and stop a broken release at staging before it reaches production.
- Release Strategies — Release to a fleet of 10 servers four ways: all at once, rolling, blue-green and canary. Measure the blast radius of a bad release and pick the right strategy.
- Rollback and Recovery — Catch a production-only bug, roll back by itself with a failure() job, check the rollback worked, measure time to restore, and choose between rollback, fix forward and feature flags.
Running Pipelines Well
- After the Deploy — Tell the team when a run fails, set alerts that are quiet but quick, read debug logs, run on Windows when you must, and keep the runner bill small.
- Delivery Metrics — The four DORA numbers: deployment frequency, lead time, change failure rate and time to restore. Simulate a team's month, find the slowest part of lead time and move all four into the green.
- Pipelines as a Product — Treat the pipeline as a product: call one shared template with inputs, give pipeline files owners with CODEOWNERS, and keep pinned versions fresh with Dependabot.
- Your Pipeline Pack — The capstone: fix a weak pipeline until it survives an incident gauntlet of bad pull requests, broken releases, a vulnerable image and an attacker, then push it to a real repo and download it as a pack.
Reference
- CI/CD Cheat Sheet — Every task from the course side by side for GitHub Actions, Azure Pipelines and GitLab CI, with the lesson that owns each idea.
- Pipeline Error Messages — The error lines you will meet in pipeline logs, what each one means, how to fix it and which lesson explains it.