name: Build and publish a Docker image to ghcr.io
on:
  # publish on releases (tagged as "x.y.z" - "v" prefix is removed)
  release:
    types: [ published ]

  # publish on pushes to the main branch (tagged as "master")
  push:
    branches:
      - master

#   pull_request: # debug

jobs:
  docker_publish:
    runs-on: "ubuntu-20.04"

    steps:
      - uses: actions/checkout@v2

      - name: Build and publish a Docker image for ${{ github.repository }}
        uses: macbre/push-to-ghcr@master
        with:
          image_name: ${{ github.repository }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

Build and publish a Docker image to ghcr.io
Build and publish a Docker image to ghcr.io