There are over 10,000 files in this artifact, consider creating an archive before upload to improve the upload performance.
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:
zip -r release.zip * .env .next
) –
Lutenist rm release.zip
–
Gilmagilman working-directory
option, and is receiving an error From directory doesn't exist
, please refer to my Q&A here. –
Rammish zip release.zip . -r
–
Hyperplane unzip -o -u packages-build.zip
to ignore the error and overwrite the files successfully. –
Ivie publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_52DFB46EC5A2427FBB1FFC3D2FA0860F }} package: release.zip
–
Auburta build: runs-on: ubuntu-latest
you will get a powershell error trying to zip with windows-latest
. –
Carmancarmarthen I also faced this issue when deploying a react based app to Azure App service.
To add to the answer written by @steve, If the App service instance is windows based, one can use Powershell's Compress-Archive.
In build steps - zipping
Compress-Archive . release.zip
In deploy steps - unzipping
Expand-Archive release.zip
or
unzip release.zip
if the deployment script is using bash
Compress-Archive * release.zip
and Expand-Archive release.zip -DestinationPath .
will must better to avoid additional folder been created. –
Whitacre I found on my case, I was using a windows hosting environment, and found the easy solution was adding the "./dist" (my output dir) instead of "." (no quotes in the file) so that it did not archive the node_modules folder. It still has an install and build command, but i've removed test, and altered this line. Mine now deploys in about 1 minute. I'm not certain what the ramifications of not archiving everything is with these artifacts as i'm new to Git, but this was able to resolve my issue, in the event someone else "just needs to get something hosted or else" as well. See code:
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: ./dist
You can zip all the files using below command and then upload the zip folder as your artifacts.
zip artifact.zip <generated_files>/*
© 2022 - 2024 — McMap. All rights reserved.