🏗️ The Continuous Integration & Deployment Pipeline Flow
📝 Complete GitHub Actions Workflow (deploy.yml)
Create a YAML workflow file inside your repository at .github/workflows/deploy.yml:
🔒 Managing Secrets & Variable Scopes
To authorize GitHub to interact with your Cloudflare account, navigate to your repository’s Settings > Secrets and variables > Actions and register the following Action Secrets:CLOUDFLARE_API_TOKEN: A secure, scoped token with Workers, D1, KV, and DNS write permissions.CLOUDFLARE_ACCOUNT_ID: Your unique 32-character Cloudflare dashboard hash.SUBDOMAIN_PREFIX: The subdomain namespace chosen for your deployments.GITHUB_TOKEN: Auto-provided, used by gitleaks for PR annotations.INTERNAL_AUTH_KEY,HOOX_API_KEY,LOAD_TEST_BASE_URL: Required for nightly k6 load tests (see Security Overview).
You never need to store worker-specific secrets (like Bybit API keys or
Telegram Bot tokens) in GitHub Secrets. These are stored directly in
Cloudflare’s secured key vaults. The CI pipeline only deploys the code logic;
the running edge isolates pull their credentials locally from Cloudflare’s
hardware-level Secret Store at runtime.
🧪 Pipeline Caching & Concurrency Controls
- Concurrency Lock: The
concurrencyblock configured in the YAML ensures that if you push a new commit while a previous deployment pipeline is running, GitHub Actions will automatically cancel the older, redundant run to avoid race conditions or double-deploying. - Bun Cache: Caching dependency directories reduces build-time installation overhead from minutes to under 8 seconds.
🔗 Next Steps
- Production Deployment Manual — Audit DNS zones and custom domain routing options.
- System Observability & Monitoring — Stream console logs and check analytics datasets.