Continuous Integration and Continuous Deployment: Cornerstones of Modern Development
CI/CD closes the loop on the branching model: code gets reviewed and merged, then automatically tested and deployed. Without it, the “merge to master means production-ready” promise falls apart — someone still has to manually run tests and push a build.
CI: Continuous Integration
CI is the practice of merging code frequently and verifying it automatically. Every push triggers a build and test run. Problems surface immediately, before they compound with other changes.
The key outcome: the main branch stays in a deployable state. You’re not saving up a month of changes for an integration weekend.
CD: Continuous Deployment
CD takes it further — passing builds automatically deploy to production (or to a staging environment in the Continuous Delivery variant). The goal is to make releasing boring: predictable, automated, and low-risk.
GitHub Actions examples
Running tests on every push:
name: Run Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
npm ci
npm test
Building and pushing a Docker image on merge to master:
name: Build and Deploy Docker Image
on:
push:
branches:
- master
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/my-app:${{ github.sha }}
Tagging with the Git commit SHA means every image is traceable back to the exact code that built it.
Other platforms
GitHub Actions is the obvious choice if you’re already on GitHub, but the concepts transfer:
- Jenkins — self-hosted, highly configurable, large plugin ecosystem. More setup overhead, more control.
- CircleCI — strong Docker support, cloud-native, language-agnostic pipelines.
- GitLab CI — built into GitLab, tightly integrated with merge requests and environments. No external service needed.
The pipeline syntax differs, but the model is the same: trigger on code events, run checks, deploy on success.
The views and opinions expressed here are my own and do not reflect those of my employer.