actions/upload-pages-artifact@v5
A composite action that prepares your static assets to be deployed to GitHub Pages
At a glance
- Latest major
v5- Repository
- actions/upload-pages-artifact
- Inputs
- 4 (1 required)
- Outputs
- 1
- Runs using
composite- License
- MIT
- Last checked
Inputs and outputs come straight from the action's official action.yml. See our editorial standards.
Usage
- uses: actions/upload-pages-artifact@v5Inputs
| Name | Required | Default | Description |
|---|---|---|---|
name | No | github-pages | Artifact name |
path | Yes | _site/ | Path of the directory containing the static assets. |
retention-days | No | 1 | Duration after which artifact will expire in days. |
include-hidden-files | No | false | Include hidden files and directories (those starting with a dot) in the artifact. Excludes .git and .github regardless. |
Outputs
| Name | Description |
|---|---|
artifact_id | The ID of the artifact that was uploaded. |
Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.
Examples
Package a built site
Create the artifact that `deploy-pages` publishes; point `path` at the build folder.
name: Example
on:
push:
branches: [main]
permissions:
contents: read
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build
run: mkdir -p dist && echo hi > dist/index.html
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: distEach example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.
Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.