New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to define if production or preview env #63
Comments
I am having the same issue. Every push or pr in any branch results in production deployment. |
I had the same issue, the workaround is to invoke the API directly to patch the |
That said, the production branch name comes from the Cloudflare API, but I'm not sure the value can be changed from |
We have multiple branches for multiple deployments and previews (our own version of a preview, that needs to be available directly at our subdomain)- but now anything we run that is not "master" branch (like PR actions etc.) are all being deployed as "preview" which is useless because now those deployments are not visible and live at our subdomain. I've run into this kind of issue before. I think Cloudflare needs to have good defaults- but always give the option to make a deployment a "production" deployment... Why can't we just provide a flag "--production" or whatever. |
You... can. Just specify the branch as your production branch (
|
Would be amazing if there was more documentation about this! EDIT: Nevermind, I see it in the Readme. My mistake, but would be nice to just have an "options" area that shows all the options available. |
Still is set as preview... This DX is really not so great. Now I have to guess what the actual "production" branch is- probably "main". I can't set this anywhere because the page project is a "direct upload" one, because we are using Github Actions. The idea of a single "production" branch doesn't really work in a lot of cases either. |
It'll either be "main" or "production" probably
You have to remember we use to have only Git, not Direct Uploads. Specifying a We could technically add an option to just do that but not sure I like that personally (feel free to put up an issue on the Wrangler docs though) |
We've managed to win with "main". Its just a lil weird because we don't even have a "main" branch (still using "master" on this repo). So overall, just opening the door for confusion. I understand that Git was how things originally worked- but surely when it comes to direct uploads, sometimes these won't even be coming from a git repo- an option just to say |
@WalshyDev I think the CF dash should be updated to let folks change the production branch when the project is set to manual upload. Right now it basically hard-codes to IMHO the rest of the functionality is fine here and the only real problem is in the CF dash. |
Yes, it needs to have this indeed. Unfortunately, it's been one of those things that just slipped into the backlog and have not been prioritized. |
For anyone else that's bumping into this and wants a quick overview on how to fix up their project's production branch as of right now... There's two steps required here:
Replace Replace 🚀 |
Hints for the above:
After making those 4 changes, copy and paste it into a Linux terminal (not command prompt, for some reason the API returns an error using the built-in Windows bash). It might be easier/more reliable to remove the
Important: I found that using the |
Hey,
So want to use CF pages on a monorepo which the new
workingDirectory
feature was designed for.Problem is, to use with monorepos, project has to be defined as a "direct upload" project which doesn't has a production branch setting in it. The only way to do it is to allow this action to have a
productionBranch
setting which is missing.Please advise.
The text was updated successfully, but these errors were encountered: