Action for deploying to git-pages.
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| action.yaml | ||
| README.md | ||
pages-deploy
Reusable Forgejo composite action that publishes a directory to a git-pages instance by uploading it as a tarball.
It authorizes with the runner's automatic token via the Forge-Authorization header, and git-pages verifies that token has push permission to the repo, so it works for private repos with no extra secret.
Check out and/or build your site first, then point the action at the output directory.
Usage
# .forgejo/workflows/deploy-pages.yaml
name: Deploy pages
on:
push:
branches: [main]
jobs:
deploy:
runs-on: nixos
steps:
- uses: actions/checkout@v5
- name: Build
run: |
mkdir -p "$RUNNER_TEMP/site"
nix run nixpkgs#cmark -- index.md > "$RUNNER_TEMP/site/index.html"
- uses: actions/pages@v1
with:
domain: example.com
path: ${{ runner.temp }}/site
If the repo already holds the finished site, check out and deploy with the default path: ..
On another forge use the full URL: uses: https://git.itanimul.li/actions/pages@v1.
Inputs
| input | required | default | description |
|---|---|---|---|
domain |
yes | – | Domain git-pages serves the site at. |
path |
no | . |
Directory to upload. |
Per-domain setup (one-time)
git-pages authorizes uploads per host, so each domain needs:
- Point the domain at the git-pages origin — a (proxied) CNAME/A record to the host running git-pages.
- Allowlist the repo so git-pages will accept a forge-authorized upload:
On upload, git-pages checks that the_git-pages-forge-allowlist.<domain> TXT "https://<forge>/<owner>/<repo>.git"Forge-Authorizationtoken has push permission to that repo before accepting the tarball.