Skip to content

Commit 96daee6

Browse files
authored
Merge pull request #236 from nanotaboada/feature/ci-container-job
chore(ci): limit container job to master branch pushes
2 parents f0d71e4 + 90a2262 commit 96daee6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/dotnet.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
container:
110110
needs: coverage
111111
runs-on: ubuntu-latest
112+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
112113

113114
permissions:
114115
contents: read
@@ -128,12 +129,15 @@ jobs:
128129
- name: Set up Docker Buildx
129130
uses: docker/setup-buildx-action@v3
130131

131-
- name: Build and push Docker image to GHCR
132+
- name: Build and push Docker image to GitHub Container Registry
132133
uses: docker/build-push-action@v6
133134
with:
134135
context: .
135136
push: true
137+
platforms: linux/amd64
138+
provenance: false
139+
cache-from: type=gha
140+
cache-to: type=gha,mode=max
136141
tags: |
137142
ghcr.io/${{ env.PACKAGE_NAME }}:latest
138-
ghcr.io/${{ env.PACKAGE_NAME }}:main
139143
ghcr.io/${{ env.PACKAGE_NAME }}:sha-${{ github.sha }}

0 commit comments

Comments
 (0)