Skip to content

CI/CD

All CI/CD runs on GitHub Actions. Workflows live in .github/workflows/.

Workflows

WorkflowFileTriggerPurpose
CIci.ymlPR to mainLint, typecheck, build, worker tests
Deploydeploy.ymlPush to mainDeploy site to Cloudflare Pages
Deploy Chat Workerdeploy-chat-worker.ymlPush to mainDeploy worker to Cloudflare Workers
Notifynotify.ymlCI/deploy complete, PR eventsSlack notifications
Release Pleaserelease-please.ymlPush to mainAutomated versioning

CI Pipeline (Pull Requests)

Two parallel jobs run on every PR:

ci — Site Checks

  1. Install: npm ci
  2. Lint: npm run lint (ESLint 9 flat config)
  3. Generate types: npx next typegen
  4. Typecheck: npm run typecheck (TypeScript)
  5. Build: npm run build (Next.js static export)

ci-chat-worker — Worker Checks

  1. Install root deps: npm ci (for KB generator)
  2. Generate KB: npm run generate-kb
  3. Install worker deps: cd chat-worker && npm ci
  4. Typecheck: cd chat-worker && npm run typecheck
  5. Test: cd chat-worker && npm test (Vitest)

Deployment Pipeline

Site Deploy (deploy.yml)

Triggers on push to main (ignores CHANGELOG.md changes).

  1. Build with environment variables injected
  2. Deploy to Cloudflare Pages via wrangler pages deploy out/
  3. Purge Cloudflare cache via API

Worker Deploy (deploy-chat-worker.yml)

Triggers on push to main (ignores CHANGELOG.md changes).

  1. Generate knowledge base from site content
  2. Verify KB exists and has content
  3. Typecheck and test
  4. 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.json version 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.