GitHub Pages "Deployment request failed (no artifact)"
actions/deploy-pages publishes a previously uploaded github-pages artifact. If the build job never ran upload-pages-artifact, or the artifact name is wrong, the deploy has nothing to publish and fails.
What this error means
The deploy-pages step fails because it cannot find a github-pages artifact for the run, even though the build appeared to succeed.
github-actions
Error: Deployment request failed
No artifact named "github-pages" was found for this workflow run.Common causes
upload-pages-artifact step missing
The build job did not upload the site with actions/upload-pages-artifact, so the deploy job has no artifact.
Deploy job does not depend on build
The deploy job runs before or independently of the build job, racing the artifact upload.
How to fix it
Upload the artifact and order the jobs
- Add actions/upload-pages-artifact in the build job pointing at the built site directory.
- Make the deploy job depend on the build job with needs.
- Re-run; deploy-pages will find the github-pages artifact.
.github/workflows/pages.yml
build:
steps:
- uses: actions/upload-pages-artifact@v3
with:
path: ./_site
deploy:
needs: build
steps:
- uses: actions/deploy-pages@v4How to prevent it
- Always pair upload-pages-artifact in build with deploy-pages in a dependent deploy job.
- Keep the artifact name as the default github-pages unless you have a reason to change it.
Related guides
GitHub Pages "Get Pages site failed" (Pages not enabled)Fix the github-pages error "Get Pages site failed" - Pages is not enabled or not set to GitHub Actions as the…
GitHub Actions "actions/deploy-pages: Failed to create deployment"Fix the actions/deploy-pages error "Failed to create deployment" - a permissions gap or a transient Pages API…
GitHub Actions upload-artifact "path traversal not allowed"Fix the GitHub Actions upload-artifact error where a path traversal outside the workspace is rejected.