Skip to content
Snippets Groups Projects
test.yml 4.14 KiB
name: Test

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - name: Get branch name
        id: branch-name
        uses: tj-actions/branch-names@v5
      
      - name: Setup Node.js environment
        uses: actions/setup-node@v2.5.0
        with:
          # Version Spec of the version to use.  Examples: 12.x, 10.15.1, >=10.15.0
          node-version: '>= 16.9.1'
          # Set this option if you want the action to check for the latest available version that satisfies the version spec
          check-latest: false
      - run: npm install -g @quasar/cli
      - run: npm install
      - run: quasar build
      - run: pwd && ls -al *
      - uses: actions/upload-artifact@v2
        with:
          name: build-artifacts-quasar
          path: dist/spa/
          if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`

      # DOCKER RELATED
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: griefed
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          build-args: BRANCH_OR_TAG=${{ steps.branch-name.outputs.current_branch }}
          file: ./Dockerfile
          platforms: linux/amd64,linux/arm/v7,linux/arm64
          push: true
          tags: |
            ghcr.io/griefed/ltt-mapmaker:${{ steps.branch-name.outputs.current_branch }}
            ghcr.io/griefed/ltt-mapmaker:${{ steps.branch-name.outputs.current_branch }}-${{ github.sha }}
            griefed/ltt-mapmaker:${{ steps.branch-name.outputs.current_branch }}
            griefed/ltt-mapmaker:${{ steps.branch-name.outputs.current_branch }}-${{ github.sha }}

  electron:
    needs: test
    runs-on: ${{ matrix.os }}

    strategy:
      matrix: