Paulund
Subscribe

CI/CD

5 March 2026, 2 min read

From the archive. Versions and APIs may have moved on since I wrote this.

On this page
  1. Continuous Integration (CI)
  2. Continuous Deployment (CD)
  3. A Typical Pipeline
  4. Common Tools
  5. GitHub Actions Example
  6. Best Practices
  7. Related

CI/CD stands for Continuous Integration and Continuous Deployment (or Continuous Delivery). Together, they automate the process of testing and releasing code, reducing the time between writing a change and getting it in front of users.

Continuous Integration (CI)

CI is the practice of merging code changes into a shared branch frequently — ideally multiple times a day. Each merge triggers an automated pipeline that:

  1. Installs dependencies
  2. Runs linters and static analysis
  3. Runs automated tests
  4. Reports pass or fail back to the pull request

The goal is to catch integration problems early, before they reach the main branch or production.

Continuous Deployment (CD)

CD takes code that has passed CI and deploys it automatically to an environment — staging, production, or both.

  • Continuous Delivery means code is automatically deployed to staging and is ready to release to production with a manual click.
  • Continuous Deployment goes one step further: every green build is deployed to production automatically, with no human step.

Which approach you use depends on how comfortable you are with fully automated releases and how robust your test suite is.

A Typical Pipeline

Text
Push to branch
  → Install dependencies
  → Lint & static analysis
  → Run tests
  → Build artefacts
  → Deploy to staging
  → Run smoke tests
  → Deploy to production (manual or automatic)

Common Tools

ToolNotes
GitHub ActionsBuilt into GitHub, YAML-based, free for public repos
GitLab CIBuilt into GitLab, powerful pipeline configuration
CircleCIFast builds, good Docker support
JenkinsSelf-hosted, highly configurable, large plugin ecosystem
Bitbucket PipelinesBuilt into Bitbucket

GitHub Actions Example

A minimal PHP + Pest pipeline in GitHub Actions:

YAML
name: Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: '8.3'
      - run: composer install --no-interaction
      - run: ./vendor/bin/pest

Best Practices

  • Keep pipelines fast — slow pipelines get ignored or bypassed
  • Fail fast: run the quickest checks first (lint before tests)
  • Use environment-specific configuration, never hard-code secrets in pipeline files
  • Store secrets as encrypted environment variables in your CI platform
  • Notify the team on failures via Slack or email

Next in Deployments

5 March 2026Containerisation

Tags

  • Deployments
  • CI/CD
  • DevOps