From 5e3381e5909f25877e8d47a23112c748825728c5 Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Wed, 22 Nov 2023 21:25:16 +0000 Subject: [PATCH] Only push images when a tag is made --- .github/workflows/publish-jvm-docker-image.yml | 2 +- .github/workflows/publish-native-docker-image.yml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-jvm-docker-image.yml b/.github/workflows/publish-jvm-docker-image.yml index 115791f0ad2..b50ebf7b9a9 100644 --- a/.github/workflows/publish-jvm-docker-image.yml +++ b/.github/workflows/publish-jvm-docker-image.yml @@ -39,6 +39,6 @@ jobs: uses: docker/build-push-action@v5 with: context: . - push: ${{ github.event_name == 'push' }} + push: ${{ startsWith(github.ref, 'refs/tags/v') }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish-native-docker-image.yml b/.github/workflows/publish-native-docker-image.yml index 1a21746c20b..5ad6b2c6100 100644 --- a/.github/workflows/publish-native-docker-image.yml +++ b/.github/workflows/publish-native-docker-image.yml @@ -47,13 +47,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Tag the native (GraalVM) Docker image + - name: Tag the native (GraalVM) Docker image and push it if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: | docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ env.DOCKER_IMAGE_NAME }}:latest docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }} - - - name: Push the native (GraalVM) Docker image - if: ${{ github.event_name == 'push' }} - run: | docker push --all-tags ${{ env.DOCKER_IMAGE_NAME }}