Set up your website (with CI)
If you use a static site generator like Jekyll, Hugo, or any other similar tool, you can integrate deployment into the Forgejo Actions workflow which builds your site.
To learn how to do this, see our documentation.
Set up your website (without CI)
If you just want to serve plain old hand-made static files, you can also configure a webhook on your repository to deploy changes to Codeberg Pages.
1 Set up your repository
Create a public repository named pages with a branch called pages to use the root of your USERNAME.codeberg.page subdomain.
or
Create a pages branch in any public repository:
git switch --orphan pagesgit rm --cached -r .
2 Set up deployment
In the Settings for your repository, go to Webhooks and click Add webhook.
Select git-pages from the drop down list of webhook types.
Set the Site URL to the URL of your website. If you don’t have a custom domain, you can use the default value. If you have a custom domain, configure it with the instructions below first.
Click Add webhook.
3 Upload your files
Push your static content, HTML, style, fonts, images or anything else to the pages branch. They will be accessible at the Site URL specified in your webhook.
Custom domain configuration
If you wish to use a custom domain, you must setup some DNS records in addition to the webhook
1 Authorization
Add a TXT record authorizing your repository to deploy your domain to the Codeberg Pages server.
Add the record to the _git-pages-repository subdomain with the Git HTTPS clone URL of your repository:
TXT https://codeberg.org/
or
If you are using Forgejo Actions to deploy your site, add the record to the _git-pages-forge-allowlist subdomain instead. For more details, see our documentation.
2 Delegation
Add a CNAME record delegating your domain to Codeberg Pages:
CNAME codeberg.page.
or
For apex domains, where CNAME doesn't work, use an ALIAS record:
ALIAS codeberg.page
or
If ALIAS isn't supported, add A+AAAA records with Codeberg's addresses:
A 217.197.84.141
AAAA 2a0a:4580:103f:c0de::2