mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +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
|
# Create and boot a loader. This will e.g., provide caching
|
||||||
# so we avoid rebuilds of the same image after this step.
|
# so we avoid rebuilds of the same image after this step.
|
||||||
- uses: docker/setup-buildx-action@v1
|
- uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
@ -43,6 +44,7 @@ jobs:
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: version
|
id: version
|
||||||
run: echo "::set-output name=RELEASE_VERSION::$(cat VERSION)"
|
run: echo "::set-output name=RELEASE_VERSION::$(cat VERSION)"
|
||||||
|
|
||||||
- name: Compute target tag
|
- name: Compute target tag
|
||||||
id: target
|
id: target
|
||||||
env:
|
env:
|
||||||
|
@ -65,15 +67,16 @@ jobs:
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
# Secrets for the login are not available for pull requests.
|
# Don't publish on forks. Also note that secrets for the login are not
|
||||||
if: github.event_name == 'push'
|
# available for pull requests, so trigger on pushes only.
|
||||||
|
if: github.repository == 'zeek/zeek' && github.event_name == 'push'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Push
|
- name: Push
|
||||||
# Only publish if we did compute a tag.
|
# 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
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: ./
|
context: ./
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue