Skip to content

Commit e5f2ba4

Browse files
Allow building (but not pushing) the container from forks (#160)
* initial commit * ensure pushing only on tags and workflow dispatches
1 parent d1570e5 commit e5f2ba4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414

1515
jobs:
1616
docker:
17-
# Need's repo owner login creds
18-
if: |
19-
(github.event_name == 'pull_request' && github.event.pull_request.user.login == github.repository_owner) ||
20-
github.actor == github.repository_owner
2117
runs-on: ubuntu-latest
2218
steps:
2319
- name: Checkout
@@ -44,11 +40,13 @@ jobs:
4440
uses: docker/setup-buildx-action@v1
4541
- name: Login to DockerHub
4642
uses: docker/login-action@v1
43+
if: github.event.ref_type == 'tag' || github.event_name == 'workflow_dispatch'
4744
with:
4845
username: ${{ secrets.DOCKERHUB_USERNAME }}
4946
password: ${{ secrets.DOCKERHUB_TOKEN }}
5047
- name: Login to GitHub Container Registry
5148
uses: docker/login-action@v1
49+
if: github.event.ref_type == 'tag' || github.event_name == 'workflow_dispatch'
5250
with:
5351
registry: ghcr.io
5452
username: ${{ github.repository_owner }}
@@ -58,7 +56,7 @@ jobs:
5856
with:
5957
context: .
6058
platforms: ${{ github.event.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
61-
push: true
59+
push: ${{ github.event.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }}
6260
tags: ${{ steps.meta.outputs.tags }}
6361
labels: ${{ steps.meta.outputs.labels }}
6462
- name: Docker Hub Description

0 commit comments

Comments
 (0)