trigger build and deployment on tags instead of branch?
I'm using a monorepo and would like to trigger builds based on tags instead of a branch, I can't seem to find anything about that in the docs. It appears this can only be done through branches, is that a hard constraint?
3 Replies
For the built-in CI/CD that's a hard restriction, it has to be based on branch commits and can't be tags. The only controls you have are which branches trigger which kinds of builds.
Simplest solution would be to disable auto deploys and then run a small CI/CD (Maybe GitHub Actions) to send a request to a deploy hook (https://developers.cloudflare.com/pages/platform/deploy-hooks/) and trigger a build
Failing that, you may need to run builds on your own CI/CD using Direct Uploads (https://developers.cloudflare.com/pages/get-started/direct-upload/) e.g. https://github.com/cloudflare/pages-action
Thank you @Erisa | Support Engineer , rather than rolling my own ci/cd I'll give a different branch approach a shot. I think I'll just maintain different long-running branches for each app, e.g., main-app1, main-app2. They'll merge back into
main
but everything else merges into main
and then releases only occur on those app-specific branches, I suppose that will be ok. We'll see 😉we need that option as well - deployments based on tags instead of branches