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 deployments within the Cloudflare ecosystem would be greatly appreciated.

You posted this same question in Discord, I’ll copy my answer from there in case it helps people in the future:

You can add custom domains to specific branches: Add a custom domain to a branch · Cloudflare Pages docs, 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: GitHub - cloudflare/pages-action, and then you can have one pages project per language if you use that and not Pages CI/CD.

Thanks you very much for your feedback. Based on the options you provided the following I am going to try:

Current setup:

  • Single repository (ngram-subdomain-pages) structure.
  • Each language has its own branch but needs to be linked to a Cloudflare Pages project.

Proposed change:

  • Transition to using GitHub Actions.
  • Deploying to Cloudflare Pages from separate repositories for each language (e.g., ngram-subdomain-pages-en, ngram-subdomain-pages-nl).
  • Automating the entire build and deployment process upon every push to these repositories.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.