diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index fca1e97d4..f23fb3067 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -1,9 +1,10 @@ name: Build Docker Image on: + release: + types: + - released # publishing of stable releases push: - tags: - - '*Release*' branches: - master pull_request: @@ -16,16 +17,18 @@ on: # Cancel earlier, unfinished runs of this workflow on the same branch (unless on release) concurrency: group: "${{ github.workflow }} @ ${{ github.ref_name }}" - cancel-in-progress: ${{ github.ref_type != 'tag' }} + cancel-in-progress: ${{ github.event_name != 'release' }} jobs: docker: name: amd64 & arm64 + if: ${{ github.repository_owner == 'Cockatrice' }} runs-on: ubuntu-latest + permissions: contents: read packages: write - + steps: - name: Checkout uses: actions/checkout@v6 @@ -52,7 +55,7 @@ jobs: uses: docker/setup-buildx-action@v4 - name: Login to GitHub Container Registry - if: github.ref_type == 'tag' + if: contains(github.event.release.tag_name, 'Release') && github.event.release.target_commitish == 'master' uses: docker/login-action@v4 with: registry: ghcr.io