Skip to content

Commit

Permalink
add artifact upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Dec 13, 2023
1 parent 32b3104 commit 80fa0f9
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions .github/workflows/webapp_build_bundle_v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
outputs:
release_upload_url: ${{ steps.get_release.outputs.upload_url }}
release_tag_name: ${{ steps.get_release.outputs.tag_name }}
webapp_bundle_name: ${{ steps.vars.outputs.webapp_bundle_name }}

steps:
- name: Get Release for tag ${{ github.ref_name }}
Expand All @@ -25,11 +24,6 @@ jobs:
with:
tag_name: ${{ github.ref_name }}

- name: Set Output vars
id: vars
run: |
echo "webapp_bundle_name=webapp-${{ steps.get_release.outputs.tag_name }}.tar.gz" >> $GITHUB_OUTPUT

build:
needs: [check]
Expand All @@ -39,10 +33,16 @@ jobs:
env:
WEBAPP_ROOT_PATH: ./src/webapp

permissions:
contents: write
outputs:
release_upload_url: ${{ needs.check.outputs.release_upload_url }}
webapp_bundle_name: ${{ steps.vars.outputs.webapp_bundle_name }}

steps:
- name: Set Output vars
id: vars
run: |
echo "webapp_bundle_name=webapp-${{ needs.check.outputs.release_tag_name }}.tar.gz" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
Expand All @@ -57,17 +57,37 @@ jobs:
CI: false
run: npm run build

- name: Create Archive
- name: Create Bundle
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
run: |
tar -czvf ${{ needs.check.outputs.webapp_bundle_name }} build
tar -czvf ${{ steps.vars.outputs.webapp_bundle_name }} build
- name: Artifact Upload
uses: actions/upload-artifact@v3
with:
name: ${{ steps.vars.outputs.webapp_bundle_name }}
path: ${{ env.WEBAPP_ROOT_PATH }}/${{ steps.vars.outputs.webapp_bundle_name }}
retention-days: 5

upload:
needs: [build]
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Artifact Download
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.webapp_bundle_name }}

- name: Upload Release Asset
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.check.outputs.release_upload_url }}
asset_name: ${{ needs.check.outputs.webapp_bundle_name }}
asset_path: ${{ env.WEBAPP_ROOT_PATH }}/${{ needs.check.outputs.webapp_bundle_name }}
upload_url: ${{ needs.build.outputs.release_upload_url }}
asset_name: ${{ needs.build.outputs.webapp_bundle_name }}
asset_path: ${{ needs.build.outputs.webapp_bundle_name }}
asset_content_type: application/gzip

0 comments on commit 80fa0f9

Please sign in to comment.