DevOps Engineer · Step 4 of 8 · 8 min
CI/CD: continuous integration and delivery
Explain what a pipeline does on every change and write a simple one.
Continuous integration
Continuous integration, CI, means every change is merged often and checked automatically. When you open a pull request, a pipeline builds the code, runs tests and linters, and reports back. Problems are found in minutes, while the change is still fresh in your mind.
Continuous delivery and deployment
Continuous delivery, CD, means every change that passes is ready to release, usually with a button press. Continuous deployment goes one step further: passing changes go to production automatically.
Both need trust in your tests. Teams add safety with staged rollouts: deploy to a test environment, then to a small share of users, then to everyone. Feature flags let you ship code switched off and turn it on later.
Pipelines as code
Pipelines are written as files in the repository, often YAML. Common tools are GitHub Actions, GitLab CI/CD, Jenkins, CircleCI and Azure Pipelines. The ideas transfer: triggers, jobs, steps, caching and artefacts.
Store secrets in the tool's secret store, never in the YAML. Give each pipeline only the permissions it needs, because a pipeline that can deploy is a valuable target for attackers.
Fast and reliable beats clever
A pipeline that takes an hour gets ignored. A pipeline that fails at random teaches people to rerun it until it is green. Keep it fast with caching and parallel jobs, and fix flaky tests instead of hiding them.
Try it
Add a CI workflow to your repository
- 1.In the repository from step 3, add a tiny script or program with one test.
- 2.Ask a chatbot the prompt below, then add the workflow file it suggests.
- 3.Check every action and version it uses against the official GitHub Actions docs before you commit.
- 4.Push and watch the run in the Actions tab. Public repositories run GitHub-hosted jobs for free.
Write a minimal GitHub Actions workflow that runs on every pull request, installs dependencies for a [language] project, and runs its tests. Use the least permissions needed. Explain each line.