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
|
default: dist
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
should_zip_artifact:
|
||||||
|
description: Whether to zip the artifact before uploading
|
||||||
|
default: "false"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -53,15 +58,29 @@ runs:
|
||||||
npm run ${{ inputs.test_action }}
|
npm run ${{ inputs.test_action }}
|
||||||
npm run ${{ inputs.build_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
|
- name: Store Node Modules Cache
|
||||||
if: always()
|
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ inputs.should_zip_artifact == 'false' }}
|
||||||
name: Build-Node-App Upload Artifact
|
name: Build-Node-App Upload Artifact
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact_name }}
|
name: ${{ inputs.artifact_name }}
|
||||||
path: ${{ inputs.build_path }}
|
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