CI/CD cheatsheet
A one-page reference for CI/CD. For the Jenkins/GitLab CI deep-dives and full side-by-side comparison, see the complete guide.
๐ Full guide: CI/CD โ IntermediateLearn this in 5 minutes5 min
- Begin with the Deployment strategies card
- Then the GitHub Actions core concepts and Example workflow cards
- Treat the other 3 cards as lookups โ scan by card title when you need one
- Open the full guide when a card isn't enough
Deployment strategiesโ
| Strategy | Idea |
|---|---|
| Rolling | replace instances gradually |
| Blue/green | switch traffic between two full environments |
| Canary | shift a small % of traffic first, watch metrics |
| Feature flags | ship dark, enable at runtime independent of deploy |
GitHub Actions core conceptsโ
- Workflow โ YAML file under
.github/workflows/. - Job โ runs on a runner, parallel by default unless
needs:links them. - Step โ a command, or an action (reusable packaged unit).
Example workflowโ
name: CI/CD
on:
push: { branches: [main] }
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
Secrets managementโ
- Never hardcode secrets in pipeline YAML.
- Use the platform's secret store (GitHub Secrets, GitLab CI/CD variables, Vault).
- Scope secrets to the job/environment that needs them, not the whole repo.
Pipeline conceptsโ
Trigger โ Build โ Test โ Package โ Deploy โ Verify
Fail fast: cheap/fast checks (lint, unit tests) run before slow ones (integration, e2e) so bad commits are rejected quickly.
Common pitfallsโ
- No rollback plan โ deploy strategy without a fast revert path.
- Flaky tests retried into passing instead of fixed โ hides real signal.
- Secrets leaked into build logs via
echoor verbose flags. - One giant monolithic pipeline instead of composable, cacheable stages.