CI: Ensure Docker runs + publishes images only on stable releases (#6839)

* Update docker-release.yml

* Update docker-release.yml

* Update docker-release.yml

* Update docker-release.yml

* Update docker-release.yml
This commit is contained in:
tooomm 2026-04-30 14:30:51 +02:00 committed by GitHub
parent 9ac9a0c73a
commit 5101cc3d74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,10 @@
name: Build Docker Image name: Build Docker Image
on: on:
release:
types:
- released # publishing of stable releases
push: push:
tags:
- '*Release*'
branches: branches:
- master - master
pull_request: pull_request:
@ -16,12 +17,14 @@ on:
# Cancel earlier, unfinished runs of this workflow on the same branch (unless on release) # Cancel earlier, unfinished runs of this workflow on the same branch (unless on release)
concurrency: concurrency:
group: "${{ github.workflow }} @ ${{ github.ref_name }}" group: "${{ github.workflow }} @ ${{ github.ref_name }}"
cancel-in-progress: ${{ github.ref_type != 'tag' }} cancel-in-progress: ${{ github.event_name != 'release' }}
jobs: jobs:
docker: docker:
name: amd64 & arm64 name: amd64 & arm64
if: ${{ github.repository_owner == 'Cockatrice' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
packages: write packages: write
@ -52,7 +55,7 @@ jobs:
uses: docker/setup-buildx-action@v4 uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry - 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 uses: docker/login-action@v4
with: with:
registry: ghcr.io registry: ghcr.io