Cloudflare Pages: Staging support

Hi,
I have a feature request for Cloudflare Pages.

I want multiple environment support to add a staging environment to my Cloudflare Pages website.

  • I want to associate the main branch to the staging environment (i.e. when I push to main, the code on the main branch should be deployed to the staging environment.), and the production branch to the production environment.
  • I want to associate domains to both staging and production. (e.g. example.com for production, and example.net for staging)

If you develop a project with a single developer, testing on the feature branch is enough, but if you collaborate with two or more developers, the website might be broken when you merge your pull request and the other developers’ PR. To avoid that, the staging environment is necessary for projects with multiple developers.

I appreciate your consideration.

On Discord, I was advised how to set up staging environment.

I wrote an article how to set up staging environments.

I like branch deployment for quick previews, but for managing environments it’s an anti-pattern. I would like environment management to work the same way as it does for workers sites, where you can specify the domain / route per environment, and choose which one to deploy to. Of course it would be nice to have both facilities - tie branch to environment, and deploy branch manually. As I say, I prefer the latter as I’d like to create an artifact of the site on merge, then choose where to deploy that to.