name: Publish Docker image to GitHub Container Registry

on:
  push:
    branches:
      - master
      - deploy
  pull_request:
    branches:
      - master

jobs:
  publish:
    name: Publish Docker image to GitHub Container Registry
    runs-on: ubuntu-latest
    steps:
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Create tag from branch
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: ghcr.io/${{ github.repository }}
          tags: |
            type=ref,event=branch
            type=ref,event=pr
      - name: Push to GitHub Packages
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: ${{ steps.meta.outputs.tags }}

name: Publish Docker image to GitHub Container Registry

on:
  push:
    branches:
      - master
      - deploy

jobs:
  publish:
    name: Publish Docker image to GitHub Container Registry
    runs-on: ubuntu-latest
    steps:
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Create tag from branch
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: ghcr.io/${{ github.repository }}
      - name: Push to GitHub Packages
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: ${{ steps.meta.outputs.tags }}

Stop building images for PRs
Stop building images for PRs
