mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Only push CI's Docker images when we're on the main repo
This commit is contained in:
parent
bac833a2f9
commit
c1ebb279ca
1 changed files with 6 additions and 3 deletions
9
.github/workflows/docker.yml
vendored
9
.github/workflows/docker.yml
vendored
|
@ -27,6 +27,7 @@ jobs:
|
|||
# Create and boot a loader. This will e.g., provide caching
|
||||
# so we avoid rebuilds of the same image after this step.
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
|
@ -43,6 +44,7 @@ jobs:
|
|||
- name: Get version
|
||||
id: version
|
||||
run: echo "::set-output name=RELEASE_VERSION::$(cat VERSION)"
|
||||
|
||||
- name: Compute target tag
|
||||
id: target
|
||||
env:
|
||||
|
@ -65,15 +67,16 @@ jobs:
|
|||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
# Secrets for the login are not available for pull requests.
|
||||
if: github.event_name == 'push'
|
||||
# Don't publish on forks. Also note that secrets for the login are not
|
||||
# available for pull requests, so trigger on pushes only.
|
||||
if: github.repository == 'zeek/zeek' && github.event_name == 'push'
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Push
|
||||
# Only publish if we did compute a tag.
|
||||
if: github.event_name == 'push' && steps.target.outputs.tag != ''
|
||||
if: github.repository == 'zeek/zeek' && github.event_name == 'push' && steps.target.outputs.tag != ''
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue