Handling Multiple Branches Linked to Multiple Cloudflare Pages Applications in a single Repository
I'm seeking advice on a deployment challenge I'm facing regarding the management of multiple branches within a single GitHub repository, each linked to multiple Cloudflare Pages applications for different languages.
The primary issue stems from the inability to link Cloudflare Pages projects to language branches due to an existing project association, which prevents the necessary branch changes. The goal is to have a Cloudflare Pages application for each language branch within the same repository, allowing for efficient management and deployment of multi-language landing pages.
I'm particularly interested in exploring solutions that allow for the seamless integration of multiple Cloudflare Pages applications within a single repository. Any insights or recommendations on best practices for handling such
1 Reply
Hmm.. you can add custom domains to specific branches: https://developers.cloudflare.com/pages/how-to/custom-branch-aliases/
but you'd still have to trigger builds for them all.
I think people usually just use internationalization plugins/tools which are more runtime based and wouldn't use multiple branches.
Your other option would be to use Direct Upload. For example, there is this Github Pages Action: https://github.com/cloudflare/pages-action, and then you can have one pages project per language if you use that and not Pages CI/CD
Cloudflare Docs
Add a custom domain to a branch · Cloudflare Pages docs
In this guide, you will learn how to add a custom domain (staging.example.com) that will point to a specific branch (staging) on your Pages project.