Search code examples
githubgithub-actions

Error: Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB


This is driving me nuts.

I have this .github/workflows/build.yml file in my repo which is an eleventy static website.

name: Build Eleventy
on:
  # Runs on pushes targeting the default branch
  push:
    branches: ["master"]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

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

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Use Node.js >= 14.x
        uses: actions/setup-node@v4
        with:
          node-version: 20.x

      - name: install dependencies
        run: npm ci

      - name: clean up
        run: npm run clean

      - name: run eleventy
        run: npm run build

      - name: fix permissions
        run: chmod -R a+rX ./_site

      - name: upload static site content
        uses: actions/upload-artifact@v4

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

I recently had to upgrade to v4 (as mentioned there)

Everything seems to go well on the build job, but when I move to the deploy job, I get:

Run actions/deploy-pages@v4
Fetching artifact metadata for "github-pages" in this workflow run
Found 1 artifact(s)
Creating Pages deployment with payload:
{
    "artifact_id": 2530520985,
    "pages_build_version": "bed7ba4b96e741349c7da1255fa20a1ac5d1acb1",
    "oidc_token": "***"
}
Created deployment for bed7ba4b96e741349c7da1255fa20a1ac5d1acb1, ID: bed7ba4b96e741349c7da1255fa20a1ac5d1acb1
Getting Pages deployment status...
Error: Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.

What's the problem?

Neither google nor chatGPT will help this time. :'(

Thanks


Solution

  • Use actions/upload-pages-artifact@v3 instead of actions/upload-artifact@v4 in upload artifact step. I was facing the exactly same issue. For more details see this github comment

    Hello!
    
    Try using actions/upload-pages-artifact instead of actions/upload-artifact.
    
    This will take care of prepping your files in the right format for GitHub Pages.