Building a simple CI/CD pipeline
This post corresponds to PR 3 in the build series.
What shipped
- A minimal CI workflow that runs the same baseline checks as local development.
- Cloudflare Workers Git integration for CD (Cloudflare builds + deploys when changes land).
- Clear “definition of done” rules for PRs in a commit-driven series.
Why
- The whole promise of this series is “post → PR → diff.” That only works if changes stay small and predictable.
- CI is how we make “boring and correct” the default state.
Definition of done (today)
- CI is green.
- The PR scope is tight enough to review quickly.
- The commit history is readable (either a single meaningful commit, or a small chain that tells a clear story).
Branch + commit conventions
- Branches:
pr/<number>-<short-slug>for work that maps 1:1 with a post. - Commits: short imperative subjects; avoid “misc”; keep diffs reviewable.
- Merge strategy: prefer squash when it improves post → diff readability.
What CI checks (for now)
- Install is reproducible (
bun install --frozen-lockfile) - Node runtime matches Astro v6 requirements (Node >= 22.12)
- Typecheck + Astro diagnostics (
astro check) - Production build (
astro build) - The workflow is codified at
.github/workflows/ci.ymland runs on PRs + pushes tomain.
What CD does (for now)
- Cloudflare connects directly to the repo and deploys on push.
- This keeps CD close to the platform, while GitHub Actions focuses on CI gates.
- Reference: Cloudflare “Git integration” docs:
https://developers.cloudflare.com/workers/ci-cd/builds/git-integration/
Where this goes next
- Automatic deploys:
main→ production, PRs/branches → preview deploys.