Skip to content

Commit

Permalink
make conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Dec 13, 2023
1 parent e43cadd commit 5cf9bf0
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/webapp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,31 @@ env:
WEBAPP_ROOT_PATH: ./src/webapp/
TAG_NAME: ${{ github.ref_name }}




jobs:
check:
runs-on: ubuntu-latest

outputs:
release_upload_url: ${{ steps.get_release.outputs.upload_url }}

steps:
- name: Get Release for tag ${{ env.TAG_NAME }}
id: get_release
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}

build:
needs: [check]
if: ${{ needs.check.outputs.release_upload_url != '' }}
runs-on: ubuntu-latest

steps:
- name: Get Release for tag ${{ env.TAG_NAME }}
id: get_release
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}

- uses: actions/checkout@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
Expand All @@ -45,11 +57,11 @@ jobs:
tar -czvf ${{ env.WEBAPP_PACKAGE_NAME }} build
- name: Upload Release Asset ${{ env.WEBAPP_PACKAGE_NAME }}
uses: actions/upload-release-asset@v1
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
upload_url: ${{ needs.check.outputs.release_upload_url }}
asset_name: ${{ env.WEBAPP_PACKAGE_NAME }}
asset_path: ${{ env.WEBAPP_ROOT_PATH }}/${{ env.WEBAPP_PACKAGE_NAME }}
asset_content_type: application/gzip
Expand Down

0 comments on commit 5cf9bf0

Please sign in to comment.