Dev.to
7/26/2026

Deploy a SonicJS CMS to Cloudflare Workers with GitHub Actions - Part 2
Short summary
A hands-on guide to deploying SonicJS CMS to Cloudflare Workers via GitHub Actions, covering wrangler.toml configuration for D1 and R2 bindings, secret management with wrangler secret put, and the critical migrate-before-deploy ordering. Includes a complete CI/CD workflow that typechecks, applies remote D1 migrations, deploys the Worker, and smoke-checks /health. Also details scoped GitHub Environment setup with required Cloudflare API token permissions.
- •Configure wrangler.toml with separate local and production sections for D1 and R2 bindings
- •Always run D1 migrations before deploying Worker code to avoid production 500s
- •Set up GitHub Actions with scoped production environment to automate migrate-and-deploy on push to main
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



