Deploy to GitHub Pages using the GitHub Pages deployment API.
The deploy-pages-api action deploys static sites to GitHub Pages using the Pages deployment API (POST /repos/{owner}/{repo}/pages/deployments) with OIDC token authentication. This is a replacement for actions/deploy-pages@v5.0.0.
Unlike the deploy-pages action (which pushes to a publish branch), this action uses the official Pages API and requires an artifact previously uploaded via upload-pages-artifact (or actions/upload-artifact).
permissions:
pages: write
id-token: write
steps:
- uses: asymmetric-effort/actions/actions/upload-pages-artifact@v1
with:
path: ./dist
- uses: asymmetric-effort/actions/actions/deploy-pages-api@v1
id: deploy
- run: echo "Deployed to ${{ steps.deploy.outputs.page_url }}"# Custom timeout and polling interval
permissions:
pages: write
id-token: write
steps:
- uses: asymmetric-effort/actions/actions/upload-pages-artifact@v1
with:
path: ./build
- uses: asymmetric-effort/actions/actions/deploy-pages-api@v1
id: deploy
with:
timeout: "300000"
reporting_interval: "10000"| Input | Description | Required | Default |
|---|---|---|---|
token |
GitHub token with pages:write permission |
No | ${{ github.token }} |
timeout |
Maximum time (ms) to wait for deployment | No | 600000 |
error_count |
Maximum consecutive polling errors before failing | No | 10 |
reporting_interval |
Interval (ms) between status polls | No | 5000 |
artifact_name |
Name of the artifact to download and deploy | No | github-pages |
| Output | Description |
|---|---|
page_url |
The URL of the deployed GitHub Pages site |
permissions:
pages: write
id-token: writeBoth permissions are required. The id-token: write permission is needed to request an OIDC token for authenticating with the Pages deployment API.
- Downloads the named artifact (default:
github-pages) produced byupload-pages-artifact - Requests an OIDC token from the GitHub Actions runtime
- Creates a Pages deployment via
POST /repos/{owner}/{repo}/pages/deployments - Uploads the artifact tarball to the deployment
- Polls the deployment status until it succeeds, fails, or times out
- Outputs the deployed page URL
- Uses OIDC tokens for API authentication (no long-lived secrets)
- The GitHub token is passed via Authorization header, never logged
- Zero third-party dependencies