Fix GitHub Pages: Missing Artifact Error

Summary

Pixel's announcement explains why the GitHub Pages deploy action reports that no github-pages artifact was found. It covers skipped or failed build jobs, missing uploads, and why deploying from a separate workflow run does not work with this artifact lookup, helping the community troubleshoot failed deployments.

DEV Community

No artifacts named github-pages were found for this workflow run

No artifacts named github-pages were found for this workflow run is actions/deploy-pages reporting that its search of the current run came back empty. The search is scoped to that run and cannot be pointed anywhere else, so the fix is always in the job graph or in the artifact name. listArtifacts is called with no findBy, so it sees the current run only. The githubstatus line comes from the catch block that wraps it. What this error means The deploy job fails on its only real step, and the log carries two messages rather than one. The first, written as an error, asks whether githubstatus.com is reporting issues with API requests, Pages or Actions, and suggests re-running the deployment later. The second names the artifact and says it was not found. Read in the order they appear, the log invites you to retry an outage. There is no outage. The suggestion is printed by a catch block that wraps every failure of that lookup, including the ordinary case where nothing was ever uploaded, and retrying will produce it again unchanged. ```Reconstructed from getArtifactMetadata in actions/deploy-pages src/internal/api-client.js (v5.0.1). Not captured from a run Fetching artifact metadata for "github-pages" in this workflow run Error: No artifacts named "github-pages" were found for this workflow run. Ensure artifacts are uploaded with actions/upload-artifact@v4 or later.

Common causes

The build job did not upload in this run

The single largest cause, and it covers several shapes: the build job was skipped by a condition, it failed before the upload step, or it is not in this workflow at all. The lookup does not care which; it reports an empty list the same way for all of them.

The deploy is in a second run triggered by the first

A workflow_run chain is a reasonable pattern for ordinary artifacts and does not work here. The action has no token or run-id input and its lookup is scoped to the run it is executing in, so a deploy in a follow-on run can never see what the build run uploaded.

The names on the two sides disagree

Both the upload and the deploy default to github-pages, so they agree until somebody changes one. Setting name on actions/upload-pages-artifact without setting artifact_name on actions/deploy-pages leaves a green upload and a red deploy, in two different jobs.

A generic upload was used instead of the Pages one

Uploading the site directory with actions/upload-artifact produces an artifact with the right name and the wrong contents, a zip of loose files rather than the single tar the deployment expects. That usually fails later than this message, but a mismatched name in the same change lands here first.

How to fix it

Read the second line, not the first

  1. Open the failed deploy job and expand the step.
  2. Ignore the sentence about githubstatus.com; it is printed for every failure of this lookup.
  3. Read the line that names the artifact, and note the name in the quotes.
  4. Open the build job in the same run and confirm an upload step ran and used that name.

Put both jobs in one workflow, with needs

This is the shape the action is designed for and the one GitHub ships in its own starter workflow. Build and upload in one job, deploy in a second with needs: on the first, both in the same file so they are always in the same run.

```.github/workflows/pages.yml (illustrative)
name: pages
on:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: npm ci && npm run build
- uses: actions/upload-pages-artifact@v5
with:
path: ./dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5
Match the names or delete them both If you renamed the ar...
Fix GitHub Pages: Missing Artifact Error
Powered by Readybot.io

The latest from Pixel

Rotate DB and Redis Passwords Without Downtime

Pixel shares a practical guide to rotating exposed database and Redis passwords without interrupting application connections. The approach updates Secrets, changes service credentials, and gradually …

AI Agent Receipts Prove What Actually Executed

Pixel’s announcement examines how public Zambo receipts verify what an AI agent actually did. A BTC price fetch succeeded with a recomputable output hash, while …

RunsOn GitHub Actions Runners: Costs and Setup

Pixel’s announcement explains how RunsOn deploys GitHub Actions runners as EC2 instances in your AWS account using a CloudFormation stack and private GitHub App. It …