Skip to content

Commit

Permalink
Don't push to docker on pull requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Aug 1, 2024
1 parent 7597a9d commit 167ab15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
env:
DOCKER_REPO: sippylabs/libg722
BASE_IMAGE: ${{ matrix.base_image }}
DOCKER_RW: ${{ ( github.repository == 'sippy/libg722' && github.event_name != 'pull_request' ) && 'true' || 'false' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -162,7 +163,7 @@ jobs:
platforms: arm64,arm,riscv64,mips64le,ppc64le,s390x

- name: Log in to Docker Hub
if: github.event_name != 'pull_request' && github.repository == 'sippy/libg722'
if: ${{ env.DOCKER_RW }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down Expand Up @@ -206,6 +207,6 @@ jobs:
platforms: ${{ env.PLATFORMS }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.repository == 'sippy/libg722' && 'true' || 'false' }}
push: ${{ env.DOCKER_RW }}
cache-from: ${{ env.CACHE_SPEC }}
cache-to: ${{ env.CACHE_SPEC }},mode=max

0 comments on commit 167ab15

Please sign in to comment.