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@v5

Inputs

NameRequiredDefaultDescription
nameNogithub-pagesArtifact name
pathYes_site/Path of the directory containing the static assets.
retention-daysNo1Duration after which artifact will expire in days.
include-hidden-filesNofalseInclude hidden files and directories (those starting with a dot) in the artifact. Excludes .git and .github regardless.

Outputs

NameDescription
artifact_idThe 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: dist

Each 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.