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?
10 Replies
PS: currently push to main branch deploy to
chefs-page.shafu.workers.dev
only.There's no support for other branches in Workers CI today
any work around? can emulate using github actions?
or do i need to create another worker instance for stag/preview ?
Yeah you can use GitHub Actions and just do a
wrangler versions upload
can we map preview urls to custom domain? like stag.example.com ??
Not today, aware it's something customers want though!
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.
for envs, you can specify those in wrangler config - https://developers.cloudflare.com/workers/wrangler/configuration/#environments
then upload/deploy with
-e <env-name>
here each enviorment will be seperate worker instance right? or can we map env to preview URL in a worker?
they'd be diff workers yeah