CI/CD
All CI/CD runs on GitHub Actions. Workflows live in .github/workflows/.
Workflows
| Workflow | File | Trigger | Purpose |
|---|---|---|---|
| CI | ci.yml | PR to main | Lint, typecheck, build, worker tests |
| Deploy | deploy.yml | Push to main | Deploy site to Cloudflare Pages |
| Deploy Chat Worker | deploy-chat-worker.yml | Push to main | Deploy worker to Cloudflare Workers |
| Notify | notify.yml | CI/deploy complete, PR events | Slack notifications |
| Release Please | release-please.yml | Push to main | Automated versioning |
CI Pipeline (Pull Requests)
Two parallel jobs run on every PR:
ci — Site Checks
- Install:
npm ci - Lint:
npm run lint(ESLint 9 flat config) - Generate types:
npx next typegen - Typecheck:
npm run typecheck(TypeScript) - Build:
npm run build(Next.js static export)
ci-chat-worker — Worker Checks
- Install root deps:
npm ci(for KB generator) - Generate KB:
npm run generate-kb - Install worker deps:
cd chat-worker && npm ci - Typecheck:
cd chat-worker && npm run typecheck - Test:
cd chat-worker && npm test(Vitest)
Deployment Pipeline
Site Deploy (deploy.yml)
Triggers on push to main (ignores CHANGELOG.md changes).
- Build with environment variables injected
- Deploy to Cloudflare Pages via
wrangler pages deploy out/ - Purge Cloudflare cache via API
Worker Deploy (deploy-chat-worker.yml)
Triggers on push to main (ignores CHANGELOG.md changes).
- Generate knowledge base from site content
- Verify KB exists and has content
- Typecheck and test
- Deploy via
wrangler deploy
Release Automation
Release Please handles versioning:
- Reads conventional commits since last release
- Creates/updates a release PR with changelog
- On merge, bumps
package.jsonversion and creates a GitHub release - Auto-merges release PRs via squash merge
Notifications
The notify.yml workflow sends Slack notifications to the Homelab workspace:
- CI results: Pass/fail for CI, Deploy, and Deploy Chat Worker workflows
- PR opened: New pull request notification
- PR merged: Merged pull request notification
Uses reusable workflows from the anshul-homelab/infrastructure repo.