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

Astro Site: Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB #345

Open
TheDevelolper opened this issue May 12, 2024 · 3 comments

Comments

@TheDevelolper
Copy link

TheDevelolper commented May 12, 2024

Like many others I'm getting the dreaded error:

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

here's my yaml file:

name: Build & Test
on:
  push:
    branches:
      - main
      - master
  pull_request:
    branches:
      - main
      - master

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

jobs:
  build:
    timeout-minutes: 60
    name: Build & Test
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: lts/*

      - name: Install Dependencies
        run: npm install && npm run install:site
      - uses: actions/upload-artifact@v4
      
        if: failure()
        with:
          name: /home/runner/.npm/_logs/
          path: /home/runner/.npm/_logs/
          retention-days: 30

      - name: Build Project
        run: npm run build
      
      - name: Install Playwright Browsers
        run: npx playwright install --with-deps

      - name: Run Playwright tests
        run: npm test
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: playwright-report
          path: playwright-report/
          retention-days: 30
      

      - name: Set Astro Dist Permisisons
        run: chmod -R 777 apps/notedrop-site/dist

      - name: Publish Project Site Artifact
        uses: actions/upload-artifact@v4
        if: ${{ github.event_name != 'pull_request' }}
        with:
          name: github-pages
          path: apps/notedrop-site/dist
          retention-days: 1

  deploy:
    needs: build
    if: ${{ github.event_name != 'pull_request' }}
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

The artifact file is produced and is under 1GB (about 1.6MB) it doesn't seem to contain any hard links or symlinks.

I've added a copy of it here, it's a very simple Astro site:
github-pages.zip

Out of desperation I tried to chmod all the files to 777 before publishing (as you can see in the pipeline.yaml). Unfortunately that didn't appear to work.

Any help you can offer would be sincerely appreciated as I've spent quite a bit of time trying researching, trying to find a fix, to no avail 😔.

@yoannchaudet
Copy link
Collaborator

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.

@TheDevelolper
Copy link
Author

@yoannchaudet Thank you so much for your quick response.

I guess it's because the upload I was using doesn't create a tar in a zip?

I'll give it a try!

@PierreOlivierBrillant
Copy link

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.

Fixed my issue. The error message should be clearer.

Indyandie added a commit to Indyandie/ebishi that referenced this issue Oct 21, 2024
Indyandie added a commit to Indyandie/ebishi that referenced this issue Oct 21, 2024
Indyandie added a commit to Indyandie/ebishi that referenced this issue Oct 21, 2024
* build(deno): migrate to deno 2 build

* fix(deno): resolve `astro dev` exceeds OS open files limit (os error 24)

issue: denoland/deno#17757

* build(deps): bump astro

* build(deno): action to deploy using deno

* fix(deno): remove broken step (test)

* fix(deno): update step

* fix(deno): add version to action path

* fix: add `uses` to deploy step

* refactor: update extension, deno install scripts, add pages step

* test: add text to validate deployment

* fix: update upload artifact to upload the `dist/` dir not `dist` file

* fix: LHTW

* fix: use correct repo `actions/upload-artifact@v4`

* fix: add id to upload artifact step

* fix: name artifact `github-pages`

* fix: try artifact v3

* fix: revert to artifact v4

* fix: use `actions/upload-pages-artifact@v3`

actions/deploy-pages#345

* chore: remove test
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

No branches or pull requests

3 participants