CI/CD
In one line
CI/CD is the practice of automatically building, testing, and deploying code every time a change is pushed.
In simple words
CI/CD stands for Continuous Integration and Continuous Delivery (or Deployment). It is an automated pipeline that takes your code from a commit all the way to production without manual intervention.
Continuous Integration (CI) means every time a developer pushes code, it is automatically merged and tested. This catches bugs early because tests run on every change, not just before release.
Continuous Delivery (CD) means the code is always in a deployable state — it is built, tested, and packaged automatically. Continuous Deployment goes one step further: every change that passes tests is automatically deployed to production.
Think of it like a factory assembly line: raw code goes in one end, tests run in the middle, and a working application comes out the other end — all automatically.
Example
# GitHub Actions CI/CD example
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm test
- run: npm run buildEvery push triggers the pipeline: checkout code, install dependencies, run tests, and build the project.
How it works
- Developer pushes code to the repository.
- CI stage: the pipeline builds the code and runs automated tests.
- If tests pass, CD stage: the code is packaged into an artifact.
- The artifact is deployed to a staging or production environment.
- If any step fails, the pipeline stops and alerts the team.
Common confusions
Confused with: Continuous Delivery
The difference: Continuous Delivery requires manual approval to deploy; Continuous Deployment deploys automatically after tests pass.
Related terms
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.