Skip to content

Deployment

Overview

Both the site and chat worker deploy automatically on push to main. Preview deployments are created for pull requests.

Portfolio Site (Cloudflare Pages)

Workflow: .github/workflows/deploy.yml

Push to main → npm ci → npm run build → wrangler pages deploy out/
                                        → Purge Cloudflare cache
  • Build output: out/ (Next.js static export)
  • Project name: portfolio
  • Domain: anshulbisen.com
  • Build env vars: NEXT_PUBLIC_POSTHOG_KEY, NEXT_PUBLIC_POSTHOG_HOST, NEXT_PUBLIC_CHAT_WORKER_URL

After deployment, the Cloudflare cache is purged via API to ensure fresh content.

Chat Worker (Cloudflare Workers)

Workflow: .github/workflows/deploy-chat-worker.yml

Push to main → npm ci → generate-kb → cd chat-worker
             → npm ci → typecheck → test → wrangler deploy
  • Worker name: portfolio-chat
  • Domain: chat.anshulbisen.com (custom domain route)
  • Knowledge base: Regenerated from site content on every deploy
  • KB verification: Checks the JSON file exists and has topics

CI Pipeline

Workflow: .github/workflows/ci.yml

Runs on every pull request to main:

Site Job (ci)

  1. npm ci
  2. npm run lint (ESLint)
  3. npx next typegen (generate types)
  4. npm run typecheck (TypeScript)
  5. npm run build (Next.js build)

Worker Job (ci-chat-worker)

  1. npm ci (root — for KB generation)
  2. npm run generate-kb
  3. cd chat-worker && npm ci
  4. npm run typecheck
  5. npm test (Vitest)

Notifications

Workflow: .github/workflows/notify.yml

Sends Slack notifications to the Homelab workspace for:

  • CI workflow results (pass/fail)
  • PR opened
  • PR merged

Uses reusable workflows from anshul-homelab/infrastructure.

Automated Releases

Workflow: .github/workflows/release-please.yml

  • Uses Release Please for automated versioning
  • Bumps version in package.json based on conventional commits
  • Auto-merges release PRs via squash merge

Required GitHub Secrets

SecretUsed In
CLOUDFLARE_API_TOKENSite deploy, cache purge
CLOUDFLARE_API_KEYWorker deploy
CLOUDFLARE_EMAILWorker deploy
CLOUDFLARE_ACCOUNT_IDSite + worker deploy
CLOUDFLARE_ZONE_IDCache purge
NEXT_PUBLIC_POSTHOG_KEYSite build
NEXT_PUBLIC_POSTHOG_HOSTSite build
SLACK_HOMELAB_TOKENNotifications