A GitHub / Gitea / Forgejo Action that publishes a built static site through a Site Manager deploy service.
- uses: xpodev/site-manager-deploy@v1
with:
url: ${{ vars.DEPLOY_URL }}
token: ${{ secrets.DEPLOY_TOKEN }}
path: distThe action packs the contents of path and uploads them. The deploy key decides where the upload goes:
- Site key: the key's own
namespace/site.sitecan be left out. - Namespace key: any site in the key's namespace. Set
siteto choose which one:
- uses: xpodev/site-manager-deploy@v1
with:
url: ${{ vars.DEPLOY_URL }}
token: ${{ secrets.DEPLOY_TOKEN }} # namespace key
path: dist
site: docsA namespace key suits a monorepo or an organization secret shared by many repos. A site key limits the damage if one repository's secret leaks. If it fails, the step shows the reason and a hint, such as a revoked key, an upload that's too large, or an unreachable server.
- In the Site Manager admin panel, create a deploy key: a site key, or a namespace key from the namespace's panel.
- In the repository settings, add:
- the secret
DEPLOY_TOKEN: the deploy key - the variable
DEPLOY_URL: the deploy service URL, e.g.https://deploy.example.com
- the secret
- Add a workflow:
name: Deploy site
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: deploy-site
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
- uses: xpodev/site-manager-deploy@v1
with:
url: ${{ vars.DEPLOY_URL }}
token: ${{ secrets.DEPLOY_TOKEN }}
path: dist- Gitea resolves
xpodev/site-manager-deploy@v1from GitHub by default (DEFAULT_ACTIONS_URL = github). - Forgejo, or a Gitea instance whose default actions URL is set elsewhere, needs the full URL:
- uses: https://github.com/xpodev/site-manager-deploy@v1The workflow file can live in .gitea/workflows/ or .forgejo/workflows/.
| Input | Required | Default | Description |
|---|---|---|---|
url |
yes | Base URL of the deploy service | |
token |
yes | Deploy key (site key or namespace key). Pass it from a secret. | |
path |
no | dist |
Folder with the built site. Its contents become the site root. |
site |
with a namespace key | Site to deploy. With a site key, leave it out or give the key's own site. | |
retries |
no | 2 |
Retries on network errors and 5xx responses |
| Output | Description |
|---|---|
namespace |
Namespace the site was deployed to |
site |
Name of the deployed site |
files |
Number of files published |
bytes |
Unpacked size of the site in bytes |
A successful run also adds the deployed site and its size to the job summary.
The runner needs bash, tar and curl. GitHub-hosted runners and the usual Gitea/Forgejo runner images have them.