Skip to content
Latchkey

actions/upload-pages-artifact

Package a directory of static assets into the artifact GitHub Pages expects.

Official actionCategory: ArtifactsLatest v5View on GitHub

What it does

actions/upload-pages-artifact archives a directory of static assets (as a single tar) and uploads it as an artifact named github-pages by default, the format actions/deploy-pages requires.

It is a composite action wrapping actions/upload-artifact with Pages-specific packaging.

Usage

workflow (.yml)
steps:
  - uses: actions/checkout@v4
  - run: npm ci && npm run build
  - uses: actions/upload-pages-artifact@v5
    with:
      path: dist/
# a separate job with pages: write + id-token: write then runs
# actions/deploy-pages to publish this artifact

Inputs

InputDescriptionDefaultRequired
nameArtifact name.github-pagesNo
pathPath of the directory containing the static assets._site/Yes
retention-daysDuration after which the artifact will expire, in days.1No
include-hidden-filesInclude hidden files and directories (dotfiles) in the artifact. Excludes .git and .github regardless.falseNo

Outputs

OutputDescription
artifact_idThe ID of the artifact that was uploaded.

Notes

Dotfiles are excluded by default. If your site needs files like .nojekyll inside the output, set include-hidden-files: true.

Keep the default artifact name github-pages unless you also set artifact_name on deploy-pages to match.

Common errors

  • No files were found with the provided path means path points at a directory that does not exist, usually the build step wrote output somewhere else.
  • A deploy that serves the wrong content usually means path pointed at the repo root instead of the built output directory.

Security and pinning

  • Upload only the built output directory, never the repo root, the artifact is exactly what gets served publicly.

Alternatives and related

Frequently asked questions

Can I use actions/upload-artifact instead?
No, deploy-pages expects the specific single-tar artifact layout this action produces. Use upload-pages-artifact for the Pages flow.

References

Running actions/upload-pages-artifact? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card