Skip to main content

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 โ†’ Intermediate
Learn this in 5 minutes5 min
  1. Begin with the Deployment strategies card
  2. Then the GitHub Actions core concepts and Example workflow cards
  3. Treat the other 3 cards as lookups โ€” scan by card title when you need one
  4. Open the full guide when a card isn't enough

Deployment strategiesโ€‹

StrategyIdea
Rollingreplace instances gradually
Blue/greenswitch traffic between two full environments
Canaryshift a small % of traffic first, watch metrics
Feature flagsship 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 echo or verbose flags.
  • One giant monolithic pipeline instead of composable, cacheable stages.
See: Common Pitfalls