diff --git a/.forgejo/actions/build-node-app/action.yaml b/.forgejo/actions/build-node-app/action.yaml index 161f6db..256381e 100644 --- a/.forgejo/actions/build-node-app/action.yaml +++ b/.forgejo/actions/build-node-app/action.yaml @@ -27,6 +27,11 @@ inputs: default: dist required: false + should_zip_artifact: + description: Whether to zip the artifact before uploading + default: "false" + required: false + runs: using: composite steps: @@ -53,15 +58,29 @@ runs: npm run ${{ inputs.test_action }} npm run ${{ inputs.build_action }} + - name: Zip Artifact + if: ${{ inputs.should_zip_artifact == 'true' }} + shell: sh + run: | + tar -czf ${{ inputs.artifact_name }}.tar.gz -C ${{ inputs.build_path }} . + echo "Artifact zipped: ${{ inputs.artifact_name }}.tar.gz" + - name: Store Node Modules Cache - if: always() uses: actions/cache/save@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - uses: actions/upload-artifact@v3 + if: ${{ inputs.should_zip_artifact == 'false' }} name: Build-Node-App Upload Artifact with: name: ${{ inputs.artifact_name }} path: ${{ inputs.build_path }} + + - uses: actions/upload-artifact@v3 + if: ${{ inputs.should_zip_artifact == 'true' }} + name: Build-Node-App Upload Zipped Artifact + with: + name: ${{ inputs.artifact_name }} + path: ${{ inputs.artifact_name }}.tar.gz