Deploy a built site artifact through GitHub Pages Actions, preserving version history in a branch when a version is supplied.
jobs:
deploy-site:
permissions:
contents: write
pages: write
id-token: write
uses: athackst/ci/.github/workflows/deploy_site.yml@main
| Name | Description | Default |
|---|---|---|
enablement |
(optional) Try to enable GitHub Pages for the repository before deploying. | false |
version |
(optional) Version identifier to publish, for example dev or 1.2.3. When empty, deploys the original artifact directly. |
"" |
artifact-name |
(optional) Artifact name containing the built site content. | github-pages |
branch |
(optional) Branch storing published versions. | gh-pages |
dry-run |
(optional) Prepare version updates and artifacts without pushing or deploying. | false |
| Name | Description |
|---|---|
token |
(optional) Token override for actions/configure-pages when enablement: true. Falls back to $. |
contents: write, pages: write, and id-token: write in the caller job.enablement: true uses a fine-grained token override, that token needs Pages: Read and write and Administration: Read and write to create or configure the Pages site.versions.json.main in the github-pages environment. Only runs from refs/heads/main can enter the Pages deployment job; version preparation can run from other refs.latest alias automatically and pushes the updated version branch. Runs outside main skip complete-site packaging and Pages deployment.main after release preparation succeeds. Other callers must arrange their own main-branch run to publish prepared releases.dev, preserves release history and the latest default, and deploys the complete updated branch. Version preparation and Pages deployment share the production queue.dry-run: true prepares version updates locally without pushing or deploying, and uploads the complete site for inspection under versioned-<artifact-name>. Unversioned dry runs skip deployment.Publish versioned docs through GitHub Pages Actions while retaining gh-pages history:
jobs:
deploy-site:
permissions:
contents: write
pages: write
id-token: write
uses: athackst/ci/.github/workflows/deploy_site.yml@main
with:
version: dev