Action to deploy static assets to Forge Pages (https://code.leon.wtf/leon/Forge-Pages)
Find a file
2025-12-27 20:35:43 +01:00
action.yml feat: added additional_base_path parameter 2025-12-27 20:35:43 +01:00
README.md feat: added additional_base_path parameter 2025-12-27 20:35:43 +01:00

Forge Pages Action

Action to deploy static content to a Forge Pages server.

Usage

...
steps:
  - uses: actions/checkout@v5
  # e.g. build a website to ./dist
  - name: Deploy to Forge Pages
    uses: https://code.leon.wtf/leon/Forge-Pages-Action@v2
    with:
      content: ./dist
      to_host: https://pages.example.com
      protect: true
      additional_base_path: dev-pr13

Parameters:

  • content: Base path of your static content.
  • to_host: Base URL of you Forge Pages server.
  • protect: If set to true, the page will be protected by a Forgejo login (via OAuth2). It can then only be viewed by users that have at least read permissions on the corresponding repository this page was deployed from.
  • additional_base_path: Additional base path to be added after the repo name part. This is useful to have multiple deployments per repository, e.g. for having test deployments per pull request.

The page will be deployed to http[s]://<repo-owner>.<forge-pages-server-base-url>/<repo-name>[/<additional_base_path]/*. The repo and owner are pulled from ${{ env.GITHUB_REPOSITORY }}.

Additionally, the action will read the workflow token from the environment (${{ env.GITHUB_TOKEN }}) to ensure that the repository has permissions to deploy to the URL. The workflow token always has permissions to write to the current repository, so if you have permissions to invoke or change a workflow, than this will succeed. This check is to ensure that pages cannot be overwritten by another repositories workflow.