CI/CD
Continuous integration and continuous delivery: every change is automatically built, tested, scanned and deployed by a pipeline.
- Type
- Engineering practice, run by a pipeline
- Tools
- GitHub Actions, GitLab CI/CD, Azure Pipelines
- Runs
- On every push and merge request
- In my stack
- Build, test, scan and deploy on every change
What it is
Continuous integration (CI) means every change pushed to the repository is automatically built and tested, so problems show up within minutes, while the change is still fresh in the developer’s mind. Continuous delivery (CD) means every change that passes is packaged and ready to deploy, and continuous deployment goes one step further and releases it automatically.
The pipeline is described in a file stored with the code and run by a service such as GitHub Actions or GitLab CI/CD. It is a series of steps: install, test, build an image, scan it, deploy to a test environment, test again, then go to production. If any step fails, the change stops there.
Why I use it
Releases become boring. Deploying is the same automated routine every time, so it can happen often and on any day, not as a stressful event once a quarter.
Security is checked every time, not once a year. OWASP ZAP attacks the running app on every deployment, so a vulnerability introduced today is found today.
Bugs are caught early. Tests run on every change, when a fix takes minutes instead of days.
A record of every release. Who changed what, which tests and scans ran, and what was deployed when: useful evidence for audits and for the change control that ISO standards ask for.
Where I use it
The HR management system goes through a CI/CD pipeline on every change. Code is tested, the Docker image is built, the release is deployed to Azure AKS, and OWASP ZAP scans the running application. A failing test stops the release before it reaches users.
Best use cases
- Any software that is changed more than once: even a small project benefits from automated tests and deployment.
- Teams with several developers, where every merge request is tested before it is merged.
- Regulated or audited environments, where every release must be traceable.
- Apps that must stay secure over time, with dependency and vulnerability scans that run without anyone having to remember.
When I’d use something else
There’s rarely a reason to skip CI entirely. What varies is how far it goes: for a prototype, running tests and deploying a preview is enough, and a heavy pipeline would slow things down. Fully automatic deployment to production isn’t always right either: when a client needs a sign-off, the pipeline prepares everything and a person clicks “deploy”.
A small example
A simplified pipeline in GitHub Actions syntax, with tool installation and registry login left out. Each step must pass for the next one to run.
on:
push:
branches: [main]
jobs:
ship:
runs-on: ubuntu-latest
env:
IMAGE: registry.example.com/api:${{ github.sha }}
steps:
- uses: actions/checkout@v4
- name: Test
run: go test ./...
- name: Build the image
run: docker build -t "$IMAGE" .
- name: Deploy to staging
run: docker push "$IMAGE" && ./deploy.sh staging "$IMAGE"
- name: Attack staging with OWASP ZAP
run: ./zap-scan.sh https://staging.example.com
- name: Deploy to production
run: ./deploy.sh production "$IMAGE"