How to map preview URLs to all non production branch git push in worker?

I am trying to deploy to *-chefs-page.shafu.workers.dev when ever there is a git push to any branch other than main branch, how to do this?
No description
10 Replies
shafu
shafuOP2w ago
PS: currently push to main branch deploy to chefs-page.shafu.workers.dev only.
Walshy
Walshy2w ago
There's no support for other branches in Workers CI today
shafu
shafuOP2w ago
any work around? can emulate using github actions? or do i need to create another worker instance for stag/preview ?
Walshy
Walshy2w ago
Yeah you can use GitHub Actions and just do a wrangler versions upload
shafu
shafuOP2w ago
can we map preview urls to custom domain? like stag.example.com ??
Walshy
Walshy2w ago
Not today, aware it's something customers want though!
shafu
shafuOP2w ago
yeah, there is not multi environment guide from cloudflare I can find, most of article/videos deploy straight into production, which is not how real world app development works.
Walshy
Walshy2w ago
for envs, you can specify those in wrangler config - https://developers.cloudflare.com/workers/wrangler/configuration/#environments then upload/deploy with -e <env-name>
shafu
shafuOP2w ago
here each enviorment will be seperate worker instance right? or can we map env to preview URL in a worker?
Walshy
Walshy2w ago
they'd be diff workers yeah

Did you find this page helpful?