Skip to content

Commit

Permalink
Enable pushes only for the default branch (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco authored Sep 29, 2022
1 parent 0927ae4 commit 1fcfcca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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}}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1fcfcca

Please sign in to comment.