On the worker build settings you can only choose a production branch, and if you push to any branches other than the one you chose for production it doesnt work (doesn’t trigger a build/deploy).
I wanted to be able to have at other branches and previews just like it is with the Pages deploy: You have a main/production branch, any pushes to that deploys to production (domain.com) and pushes to other branches triggers previews ([branchName].domain.com).
But I really cant find a way to do it with the worker build settings.
Its a shame because everything else about it is perfect, but I need to be able to at least have production and staging.
Right now the only way I found to achieve this is through “manual” deployments using wrangler on github actions.
This is a Pages feature that has not yet come to Workers. What you can do is create a separate Workers project and choose another branch as “production” and give it its own hostname. Obviously this means you have to designate a certain branch as it won’t just trigger for any branch like Pages.
Thanks for clarifying that. Just wanted to be sure that this was a limitation of the tool and not me missing something.
I’ll create separate apps for staging and production for now. Hopefully CF Workers will support preview branches like Pages does. This would make way to full feature deploy previews (pages + workers).