Deploying Preview & Production

I have a Cloudflare Pages app. So far I've been deploying from the wrangler CLI straight to prod, but I want to transition to a pipeline that's driven from Github. Firstly: it seems if you started using the CLI you can't transition to using Github as a trigger for deployment. Secondly: if you do setup a trigger using Github pushes it doesn't sync the static assets and the build fails Is this correct? I've also been looking at using Github Actions, but I can't see a way to differentiate between preview and prod. I want my merges to mast to go to prod and any other branches to trigger a preview build. Please help, big project going properly live soon and the directors are already demoing the prod environment so I don't want to mess this up.
1 Reply
stukennedy
stukennedy9mo ago
okay I figured this out ... seems that Github actions automatically send the branch name through when calling deploy, so anything on master gets to production and anything on another branch gets to preview voila!