Late to the party,1 I finally got around to experimentally moving a GitHub Pages-hosted static site to Codeberg. I wanted a low-risk site to try first, so I moved Beige Buttons, the site hosting my “90s PC turbo button simulator” web component.
Mostly for my own benefit later, here’s the steps I took and the things I learned along the way:
- You can migrate a repository across in about two clicks. Easy!
- Codeberg Pages is deployed from the
pagesbranch. If there’s no build step to the static site, all you need to do is rename themainbranch topages(and probably make it the default branch).2 - The default URL is
https://username.codeberg.page/repository. - You can use a custom domain by adding a
.domainsfile that lists domains; if migrating from GitHub Pages you can just rename yourCNAMEfile to.domains. - You’ll need to tweak your DNS
CNAME,ALIAS(or, worst-case,A/AAAA) record to point at Codeberg Pages.3
Change propogation feels slightly slower than GitHub, but perfectly tolerable.
The one thing that’s causing me trouble is that Codeberg Pages’ CORS headers prevent people from hotlinking the Beige Buttons JS, so there are some projects for which this wouldn’t be a suitable migration (issues are raised). But for most static sites, it’d probably Just Work and seems to be a great alternative.
Footnotes
1 With thanks to Kev for reminding me I’d had this on my list.
2 There are other ways to deploy but they don’t support custom domains yet.
3 Like GitHub Pages, Codeberg Pages uses LetsEncrypt for certificate provision, so you don’t need to change any CAA records.
Kev lists four reasons for migrating.
1. Microsoft ownership
2. Microsoft training Copilot on open source software
3. Large amounts of downtime
4. Reliance on big tech
What are your motivations? Why codeberg and not self-housing?
Mostly 3 & 4; I’m trying to reduce my centralisation in general. But also, Microsoft’s recent behaviour especially regarding AI has been… suboptimal.
I chose Codeberg because I’d long wanted to experiment with it. I’m not committed to it yet! But as to why I’ve used GitHub/Codeberg Pages at all rather than self-hosting: many of my static sites go many years without maintenance, and I’ve on a couple of occasions failed to migrate one along with other sites hosted on the same system, or otherwise accidentally broken them as a result of architectural changes. My aim with using GitHub Pages was always to come up with a simple, reliable system that’s tightly-bound to my source control.
I’m considering selfhosting something like Forgejo or Gitea with a “pages” plugin to achieve the same kind of thing. Or to build a simple static hosting system that “pulls” from repos, perhaps on a webhook call. I haven’t decided yet!