From 1fcfcca3ad5e7e95bec08250ec73ddfbab96bbd4 Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Thu, 29 Sep 2022 23:34:12 +0200 Subject: [PATCH] Enable pushes only for the default branch (#60) --- .github/workflows/main.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 09517fa..c9cd5ee 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -3,6 +3,8 @@ name: Build and push the container image on: # yamllint disable-line rule:truthy push: + branches: + - master pull_request: release: types: [published] @@ -38,7 +40,8 @@ jobs: "${{ env.CONTAINER_IMAGE_ID }}" "ghcr.io/${{ env.CONTAINER_IMAGE_ID }}" tags: | - type=ref,event=branch,enable={{is_default_branch}} + type=ref,event=branch + type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}}.{{patch}} type=semver,pattern={{major}}.{{minor}} @@ -80,8 +83,7 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - id: build-and-push - name: Build and push the container image + - name: Build and push the container image uses: docker/build-push-action@v3 with: cache-from: type=gha