Self-Hosted Static Pages

Deploy Static Pages with Forgejo

A seamless way to host static files for your repositories directly from your Forgejo CI/CD pipeline.

One Action to Rule Them All

Simply copy this snippet into your Forgejo Actions workflow. We handle the uploading, so you can focus on building your static assets.

  • Compatible with any static site generator (Hugo, Vite, Next.js, etc.)
  • Written in Rust for maximum performance and low overhead
  • Secure, Git-based deployment flow
workflow.yml
name: Deploy to Forgejo Pages

on:
  push:
    branches: [master]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Build Project
        run: npm run build
        # Or: yarn build / hugo build / ...
      
      - name: Deploy to Forgejo Pages
        uses: https://forge.wvffle.net/actions/deploy-page@master
        with:
          to: https://forgejo.example.com
          content: ./dist

Run Forgejo Pages Service

Use the CLI to host the Forgejo Pages service locally.

forgejo-pages
Usage: forgejo-pages --repos-dir <REPOS_DIR> --forge-host <FORGE_HOST>

Options:
  -r, --repos-dir <REPOS_DIR>      [env: REPOS_DIR=]
  -f, --forge-host <FORGE_HOST>    [env: FORGE_HOST=]
  -h, --help                       Print help

Run the Service in a Container

Deploy Forgejo Pages using Docker Compose with a single configuration file.

Use the Official Image

Pull the specific Forgejo Pages image.

Set Environment Variables

Configure the Forge host URL.

Mount Volume

Mount your repository pages to /repos.

Expose Port

Bind the exposed port 8000 to the host.

docker-compose.yml
services:
  forgejo-pages:
    image: forge.wvffle.net/wvffle/forgejo-pages
    environment:
      - FORGE_HOST=https://pages.example.com
    volumes:
      - ./repos:/repos
    ports:
      - "8000:8000"

Visit the Forge

You can view the source code for this action and the hosting infrastructure on Forgejo.

Visit the Forge