DEVOPS / A CONCEPT NOTE

CI/CD

automated pipelines that build, test, and deploy every change

~80 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

Every time you push code, a CI server (GitHub Actions, GitLab CI, Jenkins) automatically runs tests, linters, and builds. If everything passes, CD deploys the artifact to staging or production — no manual steps. The pipeline is defined in YAML in your repo, versioned alongside your code.

02 / FOLLOW THE MECHANISM

How a CI/CD pipeline runs

  1. Push

    a developer pushes code to a branch on GitHub/GitLab.

  2. Webhook

    triggers the CI server with the commit SHA and branch name.

  3. CI runner

    spins up a clean environment (container or VM), checks out the code, and runs the pipeline steps sequentially.

  4. Jobs

    run in parallel or serial — lint → unit test → build → integration test → security scan.

  5. CD deploy

    if all jobs pass on main, the pipeline promotes the artifact: Docker image push, Helm upgrade, or Terraform apply.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

list recent GitHub Actions runs

gh run list --limit 10

EXAMPLE 02 · REFERENCE

list GitHub Actions jobs locally with act

act --list

Explore command anatomy in the CLI lab