Deployment
Deployment Workflow
The application uses GitHub Actions to automatically build and deploy to Cloudflare Workers when you push code to the main branch.
Prerequisites
1. Create Cloudflare Resources
You need to create the following resources in your Cloudflare dashboard:
- D1 Database: For storing application data
2. Update Configuration Files
Update src/constants.ts
Set your site information:
export const SITE_NAME = "Your App Name";
export const SITE_DESCRIPTION = "Your app description";
export const SITE_URL = "https://your-domain.com";
GitHub Configuration
Required GitHub Secrets
Add the following secrets in your GitHub repository settings (Settings → Secrets and variables → Actions):
CLOUDFLARE_API_TOKEN— Your Cloudflare API token with the following permissions:- Account: Cloudflare Workers:Edit
- Account: D1:Edit
CLOUDFLARE_ACCOUNT_ID— Your Cloudflare account ID
Environment Variables
Cloudflare Workers Environment Variables
After successful deployment, set these environment variables in your Cloudflare Workers dashboard:
Required Secrets
# Authentication (better-auth)
BETTER_AUTH_SECRET=your-secret-key-here
BETTER_AUTH_URL=https://your-domain.com
# Email Service (if using email features)
RESEND_API_KEY=your-resend-api-key
Deployment Commands
You can check .github/workflows/deploy.yml for the full deployment workflow.