Renamed my linked GitHub repo... can I update the repo name in Pages?
I renamed the GitHub repository that I have linked to a Pages/Functions site... it's still working fine as GitHub does redirects on their side... however, can I update my existing pages/functions site to use the new GitHub repo URL without deleting and recreating the site on Pages?
6 Replies
I also have a use case where I'd want to use the same GitHub repo for 2 pages/workers sites, and that doesn't appear to be allowed at the moment.
I don't think there's any special mechanism in git to signal the updating of a new repo unless Github does some magic to keep the old repo still working (other then just redirecting). Otherwise those are both known limitations:
https://developers.cloudflare.com/pages/platform/known-issues/
After you have selected a GitHub/GitLab repository for your Pages application, it cannot be changed. Remove/delete your Pages project and create a new one pointing at a different repository if you need to update it.
Monorepos or repositories with multiple codebases/applications currently cannot use the automatic GitHub/GitLab integration to build multiple sites from the same repository. However, Direct Upload can be used to upload a monorepo as separate Pages projects from your own computer.
Known issues · Cloudflare Pages docs
Here are some known bugs and issues with Cloudflare Pages:
Thanks - I'll take a look at this... my repo got renamed as the scope of the project sort of changed. The original pages/workers project is still working fine as I guess it's following the redirects that GitHub set up.
Basically I built a game for 1 city that runs on one pages/workers site, then expanded the code to build others from the same source. I was also hoping to be able to point a 2nd pages/workers site at the same repo with a different build command. For now I've cheated, and created a second repo in my github that pulls from the first as an upstream and that's working...
First site, which is one pages/workers site on Cloudflare: https://tramgame.simonprickett.dev
Nottingham Tram Station Guessing Game
There are 50 stations on the Nottingham tram system. Can you name them all? A fun interactive map game by Simon Prickett built with Cloudflare Pages and Workers.
Second one that is the same code, different repo on github, but only really differs from the above in the parameters passed to the build command...
https://austingame.simonprickett.dev/
have fun!
Austin MetroRail Station Guessing Game
There are 9 stations on the Austin MetroRail system. Can you name them all? A fun interactive map game by Simon Prickett built with Cloudflare Pages and Workers.
You can use different branches in your repo to have multiple versions of your site working in a pages project.
{branch}.{pages-project-name}.pages.dev