Skip to content

Commit

Permalink
Merge pull request #1255 from jennydaman/fix-build-from-outside
Browse files Browse the repository at this point in the history
Do not push images if PR is from outside FNNDSC
  • Loading branch information
jennydaman authored Sep 25, 2024
2 parents 09841fd + aebdaa4 commit fcdfcbe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ on:
jobs:
build:
runs-on: ubuntu-24.04
if: github.repository_owner == 'FNNDSC' && secrets.GITHUB_TOKEN != ''
steps:
- uses: actions/checkout@v4
with:
@@ -49,11 +48,14 @@ jobs:
driver-opts: network=host
- name: Login to DockerHub
id: dockerhub_login
continue-on-error: true
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
id: ghcr_login
continue-on-error: true
uses: docker/login-action@v3
with:
registry: ghcr.io
@@ -67,11 +69,11 @@ jobs:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/386
push: true
push: ${{ steps.dockerhub_login.outcome == 'success' && steps.ghcr_login.outcome == 'success' }}

- name: Update DockerHub description
uses: peter-evans/dockerhub-description@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.dockerhub_login.outcome == 'success'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

0 comments on commit fcdfcbe

Please sign in to comment.