Add comprehensive deployment instructions for the AI Code Battle SPA. Includes setup for GitHub Actions, wrangler CLI, and manual deployment options. The build is working and ready for deployment.
2.3 KiB
2.3 KiB
Cloudflare Pages Deployment Instructions
Current Status
- ✅ Site builds successfully (run
cd web && npm run build) - ✅ Build output is in
web/dist/ - ✅ GitHub Actions workflow is configured (
.github/workflows/deploy-pages.yml) - ❌ Cloudflare API Token not configured
Deployment Options
Option 1: Set up GitHub Actions (Recommended)
-
Create a Cloudflare API Token:
- Go to https://dash.cloudflare.com/profile/api-tokens
- Create a token with Edit Cloudflare Workers permissions
- Or use this custom token config:
Account > Cloudflare Pages > Edit Zone > DNS > Edit (if using custom domain)
-
Get your Cloudflare Account ID:
- Go to https://dash.cloudflare.com
- Click on your domain/account
- Find Account ID in the right sidebar
-
Add secrets to GitHub repository:
gh secret set CLOUDFLARE_API_TOKEN --body "your_token_here" gh secret set CLOUDFLARE_ACCOUNT_ID --body "your_account_id_here" -
Trigger the workflow:
gh workflow run deploy-pages.ymlOr push a change to
web/or.github/workflows/deploy-pages.yml
Option 2: Deploy with Wrangler (Manual)
-
Install wrangler:
npm install -g wrangler -
Set environment variables:
export CLOUDFLARE_API_TOKEN="your_token_here" export CLOUDFLARE_ACCOUNT_ID="your_account_id_here" -
Deploy:
cd /home/coding/ai-code-battle/web npm run build wrangler pages deploy dist --project-name=ai-code-battle
Option 3: Create via Cloudflare Dashboard
- Go to https://dash.cloudflare.com/
- Navigate to Workers & Pages > Create application > Pages
- Choose Upload Assets
- Project name:
ai-code-battle - Upload the contents of
web/dist/
After Deployment
- Pages URL:
https://ai-code-battle.pages.dev - Verify by visiting the URL and checking the site loads
Automated Deployment (Future)
Once the GitHub Actions workflow is set up with secrets:
- Any push to
masterthat changes files inweb/will trigger deployment - Manual trigger:
gh workflow run deploy-pages.yml
Verification
# Check if site is accessible
curl -I https://ai-code-battle.pages.dev
# Or in browser
open https://ai-code-battle.pages.dev