Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not push images if PR is from outside FNNDSC #1255

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
Loading