This directory contains Cloudflare Workers that are automatically deployed via GitHub Actions.
Each worker lives in its own subdirectory with:
worker.js- The worker codewrangler.toml- Configuration file
- Worker Name:
winter-cherry-2261 - Location:
cloudflare-workers/github-auth/ - Purpose: GitHub OAuth authentication flow
- Dashboard: https://dash.cloudflare.com/6f057ad2bb65bccc304820611c01dae5/workers/services/view/winter-cherry-2261/production
npm install -g wranglerAdd these secrets to your GitHub repository at Settings → Secrets and variables → Actions:
-
CLOUDFLARE_API_TOKEN- Create at https://dash.cloudflare.com/profile/api-tokens- Use the "Edit Cloudflare Workers" template
- Or create custom token with these permissions:
- Account > Workers Scripts > Edit
- Account > Account Settings > Read
-
CLOUDFLARE_ACCOUNT_ID- Your account ID:6f057ad2bb65bccc304820611c01dae5
The github-auth worker requires these environment variables (secrets):
# Set these in Cloudflare Dashboard or via Wrangler CLI
wrangler secret put GITHUB_CLIENT_ID --env production
wrangler secret put GITHUB_CLIENT_SECRET --env production
wrangler secret put GITHUB_REDIRECT_URI --env productionOr set them in the Cloudflare Dashboard: https://dash.cloudflare.com/6f057ad2bb65bccc304820611c01dae5/workers/services/view/winter-cherry-2261/production/settings/variables
The GitHub Actions workflow (.github/workflows/deploy-cloudflare-workers.yml) will automatically deploy workers when:
- Changes are pushed to the
mainbranch - Files in
cloudflare-workers/**are modified - The workflow is manually triggered
Each worker is deployed independently - only workers with changed files are deployed.
To deploy manually from your local machine:
cd cloudflare-workers/github-auth
wrangler deploy --env productionYou'll need to authenticate with Wrangler first:
wrangler loginTo add a new worker to this monorepo:
- Create a new directory:
cloudflare-workers/your-worker-name/ - Add your worker code as
worker.js - Create a
wrangler.tomlconfiguration (copy from github-auth as template) - Add a new job to
.github/workflows/deploy-cloudflare-workers.yml(see commented example) - Push to main branch
To test a worker locally:
cd cloudflare-workers/your-worker-name
wrangler devThis starts a local server at http://localhost:8787
- Check that secrets are properly configured
- Verify the worker name in
wrangler.tomlmatches your Cloudflare worker - Check the Actions logs for specific error messages
- Regenerate your CLOUDFLARE_API_TOKEN with correct permissions
- Ensure the token hasn't expired
- Check the GitHub Actions logs to see if deployment ran
- Verify the file path filter in the workflow matches your changed files
- Try manually triggering the workflow