Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to archive files in artifact for github workflow actions in order to fix this warning?

There are over 10,000 files in this artifact, consider creating an archive before upload to improve the upload performance.

like image 285
Sem1Colon Avatar asked Jul 21 '21 13:07

Sem1Colon


People also ask

Where are GitHub action artifacts stored?

By default, the download-artifact action downloads artifacts to the workspace directory that the step is executing in. You can use the path input parameter to specify a different download directory.

How do I delete all artifacts in GitHub Actions?

Delete All Build Artifacts on Nightly Cleanups You can delete all artifacts using the kolpav/purge-artifacts-action . You can also check the delete-run-artifacts action which will help you delete all artifacts created by or attached to a workflow run once the run has completed.


1 Answers

I had this issue deploying a node app to Azure App Services.

I fixed it by adding a zip and an unzip step.

zip step is

  - name: Zip artifact for deployment
    run: zip release.zip ./* -r

unzip step is

  - name: unzip artifact for deployment
    run: unzip release.zip

Add the zip step after the build step and before Upload artifact step like this

  - name: npm install, build, and test
    run: |
      npm install
      npm run build --if-present
      npm run test --if-present

  - name: Zip artifact for deployment
    run: zip release.zip ./* -r

  - name: Upload artifact for deployment job
    uses: actions/upload-artifact@v2
    with:
      name: node-app
      path: release.zip

Then the unzip step is added after the download artifact step and before the deploy step like this.

steps:
  - name: Download artifact from build job
    uses: actions/download-artifact@v2
    with:
      name: node-app
      
  - name: unzip artifact for deployment
    run: unzip release.zip

  - name: 'Deploy to Azure Web App'
    id: deploy-to-webapp
    uses: azure/webapps-deploy@v2
    with:
like image 114
Steve Avatar answered Sep 19 '22 23:09

Steve