A unique URL and for each Workers build like Cloudflare Pages
I have a wrangler.toml file that has my name set to "website". I want to also have another worker, "website-staging" which is available on a different URL and I want that worker to build all branches. But my wrangler.toml is committed to github so it will always use that worker and overwrite my production worker. Any ideas on how I can set this up right? I feel like Cloudflare Pages had this figured out and would do a deployment to a unique URL for every build
1 Reply
https://developers.cloudflare.com/workers/wrangler/environments/
you can use different environments (e.g.
dev
, staging
, and production
).
This will not create a new subdomain for every release, but at least you won‘t override your production worker + can use different bindings in each environmentCloudflare Docs
Environments
Use environments to create different configurations for the same Worker application.