Action for deploying to git-pages.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-20 19:15:00 +02:00
action.yaml git-pages deploy composite action 2026-07-20 19:15:00 +02:00
README.md git-pages deploy composite action 2026-07-20 19:15:00 +02:00

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:

  1. Point the domain at the git-pages origin — a (proxied) CNAME/A record to the host running git-pages.
  2. Allowlist the repo so git-pages will accept a forge-authorized upload:
    _git-pages-forge-allowlist.<domain>  TXT  "https://<forge>/<owner>/<repo>.git"
    
    On upload, git-pages checks that the Forge-Authorization token has push permission to that repo before accepting the tarball.