Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dskvr opened this issue Jan 28, 2024 · 5 comments
Open

Comments

@dskvr
Copy link

dskvr commented Jan 28, 2024

  • 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

❓ ❓ ❓

@yoannchaudet
Copy link
Collaborator

👋

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

@caco3
Copy link

caco3 commented Feb 3, 2024

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

@kuboon
Copy link

kuboon commented Feb 17, 2024

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

@caco3
Copy link

caco3 commented Feb 17, 2024

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

@mauriciabad
Copy link

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

momeemt added a commit to momeemt/momee.mt that referenced this issue Aug 31, 2024
katbow added a commit to thimble-consulting/thimble-consulting.github.io that referenced this issue Sep 24, 2024
katbow added a commit to thimble-consulting/thimble-consulting.github.io that referenced this issue Sep 24, 2024
katbow added a commit to thimble-consulting/thimble-consulting.github.io that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants