Build Your First Pipeline
Minimal CI pipeline from zero to green build
1 min read
Build Your First Pipeline
Goal: validate every push builds & tests in under 5 minutes.
Prereqs
- Git repo with a small app
- Basic test command
Steps
- Add workflow file (.github/workflows/ci.yml)
- Install dependencies
- Run tests
- Cache dependencies for speed
- Surface status badge
Example (GitHub Actions)
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm test --if-present
Extend
- Add lint + type check
- Add security scan (e.g. Trivy, CodeQL)
- Add artifact packaging
Success Criteria
- Green build on main
- Failing tests block merges
- Duration < 5m
Ship the simple pipeline first; optimize after reliability.