Skip to content

Build WebApp Bundle

Build WebApp Bundle #6

name: Build WebApp Bundle
on:
release:
types: [published]
env:
WEBAPP_BUNDLE_NAME: webapp-${{ github.event.release.tag_name }}.tar.gz
WEBAPP_ROOT_PATH: ./src/webapp
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.release.upload_url != '' }} && ${{ github.event.release.tag_name != '' }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: npm install
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
run: npm install
- name: npm build
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
env:
CI: false
run: npm run build
- name: Create Archive
working-directory: ${{ env.WEBAPP_ROOT_PATH }}
run: |
tar -czvf ${{ env.WEBAPP_BUNDLE_NAME }} build
- name: Upload Release Asset
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ env.WEBAPP_BUNDLE_NAME }}
asset_path: ${{ env.WEBAPP_ROOT_PATH }}/${{ env.WEBAPP_BUNDLE_NAME }}
asset_content_type: application/gzip