name: Build

on:
  push:
    branches:
      - master
    tags:
      - v*
  pull_request:
    branches:
      - master

jobs:

  build:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login
        uses: azure/docker-login@v1
        with:
          login-server: quay.io
          username: '${{ secrets.QUAYIO_USERNAME }}'
          password: '${{ secrets.QUAYIO_PASSWORD }}'
      -
        name: Run Buildx and push
        run: |
          docker buildx build \
            --platform linux/amd64 \
            --push \
            -t quay.io/wish/eventmaster:${GITHUB_REF##*/} .

name: Build

on:
  push:
    branches:
      - master
    tags:
      - v*
  pull_request:
    branches:
      - master

jobs:

  build:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login
        if: ${{ github.event_name == 'push'}}
        uses: azure/docker-login@v1
        with:
          login-server: quay.io
          username: '${{ secrets.QUAYIO_USERNAME }}'
          password: '${{ secrets.QUAYIO_PASSWORD }}'
      -
        name: Run Buildx and push
        if: ${{ github.event_name == 'push'}}
        run: |
          docker buildx build \
            --platform linux/amd64 \
            --push \
            -t quay.io/wish/eventmaster:${GITHUB_REF##*/} .
      -
        name: Run Buildx without push
        if: ${{ github.event_name == 'pull_request'}}
        run: |
          docker buildx build \
            --platform linux/amd64 \
            --load \
            -t quay.io/wish/eventmaster:${GITHUB_REF##*/} .

Add if-clause to distinguish pushes and PRs
Add if-clause to distinguish pushes and PRs
