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)
npm cinpm run lint(ESLint)npx next typegen(generate types)npm run typecheck(TypeScript)npm run build(Next.js build)
Worker Job (ci-chat-worker)
npm ci(root — for KB generation)npm run generate-kbcd chat-worker && npm cinpm run typechecknpm 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.jsonbased on conventional commits - Auto-merges release PRs via squash merge
Required GitHub Secrets
| Secret | Used In |
|---|---|
CLOUDFLARE_API_TOKEN | Site deploy, cache purge |
CLOUDFLARE_API_KEY | Worker deploy |
CLOUDFLARE_EMAIL | Worker deploy |
CLOUDFLARE_ACCOUNT_ID | Site + worker deploy |
CLOUDFLARE_ZONE_ID | Cache purge |
NEXT_PUBLIC_POSTHOG_KEY | Site build |
NEXT_PUBLIC_POSTHOG_HOST | Site build |
SLACK_HOMELAB_TOKEN | Notifications |