3.2 KiB
3.2 KiB
Deployment Summary
Current Setup
✅ Frontend: Cloudflare Pages
- Deployment: Automatic on push to
mainbranch - Build:
npm run build - Output:
dist/ - Configuration: Set in Cloudflare Pages dashboard
- Environment Variables: Set in Cloudflare Pages dashboard (VITE_* variables)
✅ Worker: GitHub Actions
- Production: Deploys on push to
mainbranch → useswrangler.toml - Dev: Deploys on push to
automerge/**branches → useswrangler.dev.toml - Manual: Can trigger via GitHub Actions UI with environment selection
❌ Vercel: Can be disabled
- Frontend is now on Cloudflare Pages
- Worker was never on Vercel
- You can safely disconnect/delete the Vercel project
Why GitHub Actions for Workers?
GitHub Actions is better than Cloudflare's automatic worker deployments because:
- ✅ More Control: You can add tests, checks, conditional logic
- ✅ Better Branching: Different configs for dev vs prod
- ✅ Manual Triggers: Deploy specific environments on demand
- ✅ No Conflicts: Single source of truth (no competing deployments)
- ✅ Version Tracking: All deployments tracked in GitHub
- ✅ Flexibility: Can add deployment gates, notifications, etc.
Cloudflare's automatic worker deployments:
- ❌ Less control over the process
- ❌ Can conflict with GitHub Actions
- ❌ Harder to debug when issues occur
- ❌ Limited branching/environment support
Environment Switching
For Local Development
You can switch between dev and prod workers locally using:
# Switch to production worker
./switch-worker-env.sh production
# Switch to dev worker
./switch-worker-env.sh dev
# Switch to local worker (requires local worker running)
./switch-worker-env.sh local
This updates .env.local with VITE_WORKER_ENV=production or VITE_WORKER_ENV=dev.
Default: Now set to production (changed from dev)
For Cloudflare Pages
Set environment variables in Cloudflare Pages dashboard:
- Production:
VITE_WORKER_ENV=production - Preview:
VITE_WORKER_ENV=dev(for testing)
Deployment Workflow
Frontend (Cloudflare Pages)
- Push to
main→ Auto-deploys to production - Create PR → Auto-deploys to preview environment
- Environment variables set in Cloudflare dashboard
Worker (GitHub Actions)
- Production: Push to
main→ Auto-deploys to production worker - Dev: Push to
automerge/**branch → Auto-deploys to dev worker - Manual: Go to Actions → "Deploy Worker" → Run workflow → Choose environment
Testing Both Environments
Local Testing
# Test with production worker
./switch-worker-env.sh production
npm run dev
# Test with dev worker
./switch-worker-env.sh dev
npm run dev
Remote Testing
- Production: Visit your production Cloudflare Pages URL
- Dev: Visit your dev worker URL directly or use preview deployment
Next Steps
- ✅ Disable Vercel: Go to Vercel dashboard → Disconnect repository
- ✅ Verify Cloudflare Pages: Ensure it's deploying correctly
- ✅ Test Worker Deployments: Push to main and verify production worker updates
- ✅ Test Dev Worker: Push to
automerge/testbranch and verify dev worker updates