Skip to main content
stuff&things

An 11ty Site, Codeberg Pages, and Cron

Some time ago I moved my 11ty site from Cloudflare and Github to Codeberg Pages. It was not without its trial and tribulations but this tutorial from user johnnyjayjay was invaluable and, in fact, I deviated very little from it for deploying the site from terminal to Codeberg Pages.

That said, the other issue I wanted to resolve was rebuilding the site every few hours to capture any social media posts for the Social page, which is just my Mastodon posts. In my research for it, I found plenty of posts about deploying but not necessarily setting up a cron job.

Codeberg does have plenty of documentation and eventually I found enough articles that pointed me to using their Woodpecker CI to implement my .woodpecker.yml file. If you want to use the CI, you’ll need to request access first. I think it took about 45 minutes to get access, but I also requested late at night.

Once you have access, you’ll need to log into Woodpecker using your Codeberg credentials, give access to the repos you want, and set up two secrets (one for a Codeberg token, one for the repo name), under Settings. You’ll also set up the cron details here as well.

For the Codeberg token, log into your account and go to Account Settings > Applications and set up a token. You’ll only need to give it read/write repo access (but can give it whatever other additional access you like, if you choose). This is focusing on actually setting the yml file up for an 11ty site. Once you create the token, copy it to the Woodpecker secret. For the repo secret, the variable should be in the format username/repo.

So, with all of that out the way, the actual yml file, which goes in the root of your source website’s repo (not the pages repo), looks like this:

when:
  event: cron
  cron: deploy-pages

steps:
  - name: build
    image: node:20-alpine
    commands:
      - apk add --no-cache git
      - npm install
      - npm run build

  - name: deploy
    image: alpine:latest
    environment:
      CB_TOKEN:
        from_secret: cb_token
      CB_REPO:
        from_secret: cb_repo
    commands:
      - apk add --no-cache git openssh-client
      - git config --global user.name "Woodpecker CI"
      - git config --global user.email "woodpecker@ci"
      - cd dist
      - git init
      - git checkout -b pages
      - git add .
      - git commit -m "Deploy to Codeberg Pages [CI]"
      - git push --force https://$CB_TOKEN@codeberg.org/$CB_REPO.git HEAD:main

A few things to note here. The image I’m using is node:20-alpine because I’m running the 11ty version 4.0-alpha, which requires >20. The cb_token and cb_repo are the secrets I created in Woodpecker – name them whatever but the name should be lowercase. Finally, you’ll note there are not {} around the tokens in the git push command at the end. That is not a typo.

I hope this helps someone else out there. I may update with more details instructions on setting up the secrets and/or the cron in Woodpecker.

Likes (1)

Reposts (1)

photo of the author of one of the webmentions for this page

Comments (1)

photo of the author of one of the webmentions for this page

@jasonm What I am little confused about codeberg (because it sounds otherwise intriguing as I am hosting on CF and have my repo on GH at the moment): Do you have the option to keep your repo private? Do you know? (It’s not like that I have something to hide, but it is not really an open source project either… and making it private means less decision making in general.)

October 9, 2025