Codeberg Pages
This documentation site is deployed to Codeberg Pages using Woodpecker CI. Every push to the main branch automatically rebuilds and publishes the docs.
How it works
- You push to
main - Woodpecker CI builds the VitePress site (
docs/) - The built static files are force-pushed to the
pagesbranch - Codeberg Pages serves the
pagesbranch atYOUR_USERNAME.codeberg.page/REPO_NAME
One-time setup
1. Enable Woodpecker CI for your repo
- Go to ci.codeberg.org
- Sign in with your Codeberg account
- Click Add repository and activate your homepage repo
2. Create a Codeberg access token
Woodpecker needs push access to deploy to the pages branch.
- On Codeberg, go to Settings → Applications → Access Tokens
- Click Generate Token
- Name it
WOODPECKER_PAGESand grant the repository scope - Copy the token — you won't see it again
3. Add the token as a Woodpecker secret
- In Woodpecker, open your repo's Settings → Secrets
- Click Add Secret
- Name:
CODEBERG_TOKEN, Value: paste the token - Save
4. Create the pages branch
Woodpecker will push to this branch automatically, but it needs to exist first:
git checkout --orphan pages
git rm -rf .
echo "placeholder" > index.html
git add index.html
git commit -m "init pages branch"
git push origin pages
git checkout main5. Push to trigger the first build
git push origin mainWatch the build at ci.codeberg.org. On success, the docs will be live at:
https://YOUR_USERNAME.codeberg.page/REPO_NAME/Custom domain
To use a custom domain, add a .domains file to the root of the pages branch containing your domain name, then configure a CNAME DNS record pointing to codeberg.page.
Woodpecker config reference
The .woodpecker.yml at the root of the repo defines the pipeline:
steps:
- name: build
image: node:20-alpine
commands:
- cd docs
- npm install
- npm run build
- name: deploy
image: bitnami/git
environment:
CODEBERG_TOKEN:
from_secret: CODEBERG_TOKEN
commands:
- git config --global user.email "[email protected]"
- git config --global user.name "Woodpecker CI"
- git clone https://[email protected]/YOUR_USERNAME/YOUR_REPO.git /tmp/deploy
- cd /tmp/deploy
- git checkout pages
- git rm -rf .
- cp -r /workspace/docs/.vitepress/dist/. .
- touch .nojekyll
- git add .
- "git commit -m 'Deploy docs [ci skip]' || echo 'Nothing to commit'"
- git push origin pages
when:
branch: mainUpdating the docs
Edit any file under docs/ and push to main. The pipeline runs automatically and the live site updates within a minute or two.
To preview locally before pushing:
cd docs
npm install # first time only
npm run devThen open http://localhost:5173.