name: Build BAB Application Deployment Artifact
run-name: ${{ gitea.actor }} is building an artifact 🚀
on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-18.04
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: '20.x'
      - name: Install dependencies
        run: npm install
      - name: Install yarn
        run: npm install --global yarn
      - name: Install Quasar CLI
        run: npm install -g @quasar/cli
      - name: Build Project
        run: quasar build -m pwa
      - name: Get Version Number
        id: get_version
        run: echo "::set-output name=VERSION::$(node -p "require('./package.json').version")"
      - name: Create Tarball of Build
        run: tar -czvf build-${{ steps.get_version.outputs.VERSION }}.tar.gz dist/pwa
      - name: Upload Tarball
        uses: actions/upload-artifact@v3
        with:
          name: build-artifact-${{ steps.get_version.outputs.VERSION }}
          path: build-${{ steps.get_version.outputs.VERSION }}.tar.gz
