feat: add artifact zipping option and update upload steps
This commit is contained in:
parent
aa49da3631
commit
50326ce91f
1 changed files with 20 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue