What a Good CI/CD Pipeline Actually Does
Not just "runs tests before deploy." A real pipeline:
Validates code quality (lint, types, tests)
Builds artifacts
Deploys to staging automatically
Gates production on approval or scheduled windows
Rolls back automatically on failure
Here's how to build one with GitHub Actions.
The Base Pipeline
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Type check
run: npx tsc --noEmit
- name: Lint
run: npm run lint
- name: Test
run: npm test -- --coverage
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Discussion
Begin the discussion
Begin something meaningful by sharing your ideas.