diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9f404d6..44eca0c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,8 @@ on: push: branches: [main] tags: ["v*"] + release: + types: [published] permissions: contents: read @@ -19,7 +21,7 @@ jobs: - uses: docker/setup-buildx-action@v4 - name: Log in to GHCR - if: github.event_name != 'pull_request' + if: github.event_name == 'release' uses: docker/login-action@v4 with: registry: ghcr.io @@ -31,14 +33,14 @@ jobs: with: images: ghcr.io/solmath/infoscreen tags: | - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=latest,enable=${{ github.event_name == 'release' }} type=sha type=semver,pattern={{version}} - uses: docker/build-push-action@v7 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name == 'release' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha