deploy-pages icon indicating copy to clipboard operation
deploy-pages copied to clipboard

Error: No artifacts named "github-pages" were found for this workflow run.

Open dskvr opened this issue 4 months ago • 4 comments

  • Was ran with debug logging on
  • Tried many solutions before coming here
  • permissions appear to be correctly set
  • steps are sequentially correct

From actions/update-pages-artifact step

##[debug]Starting: run
##[debug]Loading inputs
##[debug]Evaluating: inputs.name
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'name'
##[debug]=> 'github-pages'
##[debug]Result: 'github-pages'
...
##[debug]Artifact github-pages has been successfully uploaded, total size in bytes: 133120

From "Artifacts" section in summary

Screenshot_20240128_221843

From actions/deploy-pages

##[debug]Headers: {
##[debug]  "content-length": "16",
##[debug]  "content-type": "application/json",
##[debug]  "date": "*** GMT",
##[debug]  "x-github-backend": "Kubernetes",
##[debug]  "x-github-request-id": "***"
##[debug]}
##[debug]Body: {
##[debug]  "artifacts": []
##[debug]}
Found 0 artifact(s)
##[debug]List artifact count: 0
Error: Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages, or Actions? Please re-run the deployment at a later time.
Error: Error: No artifacts named "github-pages" were found for this workflow run. Ensure artifacts are uploaded with actions/artifact@v4 or later.
    at getArtifactMetadata (/home/runner/work/_actions/actions/deploy-pages/v4/src/internal/api-client.js:85:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Deployment.create (/home/runner/work/_actions/actions/deploy-pages/v4/src/internal/deployment.js:66:1)
    at main (/home/runner/work/_actions/actions/deploy-pages/v4/src/index.js:30:1)
Error: Error: No artifacts named "github-pages" were found for this workflow run. Ensure artifacts are uploaded with actions/artifact@v4 or later.
##[debug]Node Action run completed with exit code 1

Workflow

name: Build & Deploy Demo
on:
  workflow_dispatch:
  push:
    branches: [main]

jobs:

  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pages: write
      id-token: write
    steps:
      - uses: actions/checkout@v3

      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20' # Use a Node.js version that supports ES Modules
          registry-url: 'https://registry.npmjs.org'

      - name: Install Dependencies
        run: yarn install

      - name: Build Package
        run: yarn build

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v2
        with:
          name: 'github-pages'
          path: 'dist'

  deploy:
    runs-on: ubuntu-latest
    needs: build
    permissions:
      contents: read
      pages: write
      id-token: write
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

:question: :question: :question:

dskvr avatar Jan 28 '24 22:01 dskvr

👋

You are using our latest deploy-pages Actions (v4) which leverage the new Actions Artifact feature. Just try to also update upload-pages-artifact to the latest (which is v3).

yoannchaudet avatar Jan 29 '24 18:01 yoannchaudet

I have the very same issue. v3 still works, v4 throws this error.

caco3 avatar Feb 03 '24 15:02 caco3

Adding config before deploy worked for me

  deploy:
    needs: build
    permissions:
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
    - name: Configure Pages
      uses: actions/configure-pages@v4
    - name: Deploy to GitHub Pages
      id: deployment
      uses: actions/deploy-pages@v4

kuboon avatar Feb 17 '24 02:02 kuboon

Hmm, not sure if this is the solution, because that's what we had more or less (Just additionally actions/upload-pages-artifact@v2 between): See https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/.github/workflows/build.yaml#L421

caco3 avatar Feb 17 '24 08:02 caco3

Check out these examples: https://github.com/actions/starter-workflows/tree/main/pages

mauriciabad avatar Apr 27 '24 13:04 mauriciabad