Goal: Auto-deploy everything on git push origin main
| Component | Files Watched | Auto-Deploy | Status |
|---|---|---|---|
| Website | docs/* |
✅ Yes | Cloudflare Pages |
| Worker | worker/* |
⚠️ Needs secrets | GitHub Actions |
URL: https://github.com/ravitejakamalapuram/echokit/settings/secrets/actions
Name: CLOUDFLARE_API_TOKEN
Value: [paste your Cloudflare API token here]
Use the token you created: cfut_tjMzT...6e486197 (the one you just provided)
Name: CLOUDFLARE_ACCOUNT_ID
Value: e08ac904468d19ea525b3005cc54888b
After adding secrets, let’s test that auto-deploy works:
# Make a small change to trigger deployment
echo "// Auto-deploy test" >> worker/worker.js
git add worker/worker.js
git commit -m "test: Verify auto-deploy works"
git push origin main
What happens:
worker/ folder.github/workflows/deploy-worker.ymlapi.echo-kit.com in ~30 secondsCheck deployment:
Triggers:
docs/ foldermain branchExample:
vim docs/index.html
git add docs/index.html
git commit -m "Update homepage"
git push origin main
# ✅ Auto-deploys to echo-kit.com in ~30 seconds
Monitor:
Triggers:
worker/ foldermain branchExample:
vim worker/worker.js
git add worker/worker.js
git commit -m "Update API logic"
git push origin main
# ✅ GitHub Actions auto-deploys to api.echo-kit.com in ~30 seconds
Monitor:
| File Changed | What Happens | Deploy Time | Live URL |
|---|---|---|---|
docs/index.html |
Cloudflare Pages deploys | ~30s | https://echo-kit.com |
docs/privacy.html |
Cloudflare Pages deploys | ~30s | https://echo-kit.com |
docs/faq.html |
Cloudflare Pages deploys | ~30s | https://echo-kit.com |
docs/*.html |
Cloudflare Pages deploys | ~30s | https://echo-kit.com |
worker/worker.js |
GitHub Actions → Worker | ~30s | https://api.echo-kit.com |
worker/wrangler.toml |
GitHub Actions → Worker | ~30s | https://api.echo-kit.com |
worker/package.json |
GitHub Actions → Worker | ~30s | https://api.echo-kit.com |
README.md |
No deployment | - | GitHub only |
*.sh scripts |
No deployment | - | Local only |
File: .github/workflows/deploy-worker.yml
What it does:
worker/ folder for changesmain, triggers deploymentcloudflare/wrangler-action@v3wrangler deployManual trigger:
Once you’ve added the GitHub secrets:
CLOUDFLARE_API_TOKEN secretCLOUDFLARE_ACCOUNT_ID secretworker/worker.jsmain branchcurl https://api.echo-kit.com/__healthYou’ll know automation is working when:
docs/mainecho-kit.com in ~30 secondsworker/mainapi.echo-kit.com in ~30 secondswrangler deploy needed ✅docs/ AND worker/mainSolution:
Solution:
worker/ folder.github/workflows/deploy-worker.ymlSolution:
GitHub Actions:
Cloudflare Pages:
Cloudflare Worker:
After adding the secrets:
Total Setup Time: 2 minutes
Monthly Cost: $0
Automation Level: 100% ✨