CI/CD Pipelines
CI/CD Pipelines
Overview
Continuous Integration (CI) runs checks on every change. Continuous Delivery/Deployment (CD) automates releasing changes to environments.
Typical stages
- Lint and format
- Unit and integration tests
- Build and artifact creation
- Deploy to staging/prod
Example (GitHub Actions)
name: ci
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test -- --ci
Checklist
- Protect main branch with required checks
- Keep pipelines fast (<10 min)
- Cache dependencies
Resources
- docs.github.com/actions
- CircleCI, GitLab CI docs