Skip to content

Commit 32bbd70

Browse files
committed
.github: don't log in to registries on non-main
1 parent 8e18c5a commit 32bbd70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/docker-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ jobs:
1616
uses: docker/setup-buildx-action@v3
1717
-
1818
name: Login to GitHub Registry
19+
if: ${{ github.ref == 'refs/heads/main' }}
1920
uses: docker/login-action@v3
2021
with:
2122
registry: ghcr.io
2223
username: ${{ github.repository_owner }}
2324
password: ${{ secrets.GITHUB_TOKEN }}
2425
-
2526
name: Login to DockerHub
27+
if: ${{ github.ref == 'refs/heads/main' }}
2628
uses: docker/login-action@v3
2729
with:
2830
username: erisamoe
@@ -36,4 +38,4 @@ jobs:
3638
push: ${{ github.ref == 'refs/heads/main' }}
3739
set: |
3840
*.cache-from=type=gha
39-
*.cache-to=type=gha,mode=max
41+
*.cache-to=type=gha,mode=max

0 commit comments

Comments
 (0)