Migrating my Quarto site from GitHub to Codeberg

It’s been a while since I’ve blogged and a lot has changed! I have a new employment situation (half time with the U of A and half time with grant witness), the USA is sliding further into fascism (but let’s not get into that too much right now), and GitHub is no longer acting independently of its owner, Microsoft1. This last bit has prompted many people to move projects from GitHub to Codeberg, a non-profit git remote hosting service that respects privacy and won’t sell your code for AI training. I finally got around to migrating this site and it was pretty darn easy.
Codeberg provides migration tools that let you create a new Codeberg repository from a GitHub (or GitLab) repository and it even migrates over issues, releases, milestones, etc, so getting the code over to https://codeberg.org/ericrscott/website-quarto was the easy part!
Back on GitHub, I had a couple of GitHub Actions set up to automate publishing the site to Netlify whenever code changed and checking that quarto render still worked on pull requests. Codeberg’s equivalent of GitHub actions is Woodpecker CI. Woodpecker CI is actually an independent free and open source project, but Codeberg runs an instance of Woodpecker CI that you can apply to get access to. Similar to GitHub Actions, Woodpecker CI actions are defined in YAML files (in a .woodpecker/ folder instead of .github/workflows/), but the syntax is of course different. The good news is that Woodpecker CI is well documented and once you get used to it, the mental model is a lot simpler than GitHub actions, in my opinion. With Woodpecker CI your repo is cloned automatically (so no actions/checkout@v3 needed!), and your possible runners are any docker container. Pre-built “actions” are also docker containers, and there is no messing with artifacts or having to commit files to pass them from step to step, because in a more complicated Woodpecker CI pipeline, your project is just like a volume that is mounted successively to the different docker container runners. You can even see the simplicity in the YAML files I think. I went from this GitHub Action:
on:
push:
branches: main
name: Quarto Publish
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: netlify
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}to this Woodpecker CI action:
when:
- event: push
branch: "main"
steps:
- name: build quarto
image: rocker/verse # preferred, because it comes preinstalled with quarto
environment:
NETLIFY_AUTH_TOKEN:
from_secret: netlify_token
commands:
- command -v quarto || (echo "quarto cli not installed"; exit 1)
- quarto publish netlifyThere’s no checkout or install Quarto steps because checkout is implied and I’m using rocker/verse as a runner which already has Quarto installed. Now there’s not (yet) an equivalent of quarto-dev/quarto-actions/publish, but it’s simple enough to do in the command line. I also like that you can write bash commands as a sort of bulleted list.
The ease of working with Woodpecker CI also prompted me to figure out how to set up an action that updates my site’s robots.txt from ai-robots-txt/ai.robots.txt regularly.
Once that was set up, I just needed to replace all the links to GitHub with links to Codeberg (e.g. the source code and issue links). The last piece, which I haven’t done yet, is that blog post comments (such as the ones below this post) are hosted on GitHub discussions via giscus. I’m going to need to find an alternative, so let me know in the comments if you have any ideas! Hopefully I can migrate all the past blog post comments to whatever new system I end up using.
I’ll definitely be reaching for Codeberg as a platform for new personal projects and I may get around to moving some additional repos from my GitHub over to Codeberg.