aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Wojtek <woj-tek@users.noreply.github.com> 2024-07-18 03:28:16 +0200
committerGravatar GitHub <noreply@github.com> 2024-07-17 18:28:16 -0700
commit8cfe77a3cdfd8e9c7e647e3149d0df813c58aa87 (patch)
treeaf761090f2d2b7a49bc941cb0a7a186fe117c80e
parent8d4d092cd77195b7d9d262e566bb41d691aedc4e (diff)
downloadv2-8cfe77a3cdfd8e9c7e647e3149d0df813c58aa87.tar.gz
v2-8cfe77a3cdfd8e9c7e647e3149d0df813c58aa87.tar.zst
v2-8cfe77a3cdfd8e9c7e647e3149d0df813c58aa87.zip
build: publish OCI images only if `PUBLISH_DOCKER_IMAGES=true`
-rw-r--r--.github/workflows/docker.yml8
1 files changed, 5 insertions, 3 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index b969e69d..6d272101 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -54,14 +54,14 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
- if: github.event_name != 'pull_request'
+ if: ${{ github.event_name != 'pull_request' && vars.PUBLISH_DOCKER_IMAGES == 'true' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
- if: github.event_name != 'pull_request'
+ if: ${{ github.event_name != 'pull_request' && vars.PUBLISH_DOCKER_IMAGES == 'true' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
@@ -69,7 +69,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay Container Registry
- if: github.event_name != 'pull_request'
+ if: ${{ github.event_name != 'pull_request' && vars.PUBLISH_DOCKER_IMAGES == 'true' }}
uses: docker/login-action@v3
with:
registry: quay.io
@@ -78,6 +78,7 @@ jobs:
- name: Build and Push Alpine images
uses: docker/build-push-action@v6
+ if: ${{ vars.PUBLISH_DOCKER_IMAGES == 'true' }}
with:
context: .
file: ./packaging/docker/alpine/Dockerfile
@@ -87,6 +88,7 @@ jobs:
- name: Build and Push Distroless images
uses: docker/build-push-action@v6
+ if: ${{ vars.PUBLISH_DOCKER_IMAGES == 'true' }}
with:
context: .
file: ./packaging/docker/distroless/Dockerfile