From 84632a0c7d36663015acb6b1423feea1bafab318 Mon Sep 17 00:00:00 2001 From: Sung Yun <107272191+sungwy@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:29:38 +0000 Subject: [PATCH] fix --- .github/workflows/publish-docker.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 94ae5b9eb021..5526bc16f7ed 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -27,6 +27,7 @@ on: env: DOCKER_IMAGE_TAG: iceberg-rest-fixture + DOCKER_IMAGE_VERSION: latest jobs: build: @@ -42,13 +43,13 @@ jobs: - name: Login to Docker Hub run: | docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build Docker Image - run: docker build -t ${{ secrets.DOCKERHUB_USER }}/$DOCKER_IMAGE_TAG -f docker/iceberg-rest-adapter-image/Dockerfile . - - name: Push Docker Image with latest tag - if: github.event_name == 'workflow_dispatch' - run: docker push ${{ secrets.DOCKERHUB_USER }}/$DOCKER_IMAGE_TAG:latest - - name: Push Docker Image with version tag + - name: Set the tagged version if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + run: | + echo "DOCKER_IMAGE_VERSION=`echo refs/tags/apache-iceberg-1.7.1 | tr -d -c 0-9.`" >> "$GITHUB_ENV" + - name: Build Docker Image + run: docker build -t ${{ secrets.DOCKERHUB_USER }}/$DOCKER_IMAGE_TAG:$DOCKER_IMAGE_VERSION -f docker/iceberg-rest-adapter-image/Dockerfile . + - name: Push Docker Image # for tag 'apache-iceberg-1.7.0', publish image 'apache/iceberg-rest-fixture:1.7.1' run: | - docker push ${{ secrets.DOCKERHUB_USER }}/$DOCKER_IMAGE_TAG:`echo refs/tags/apache-iceberg-1.7.1 | tr -d -c 0-9.` + docker push ${{ secrets.DOCKERHUB_USER }}/$DOCKER_IMAGE_TAG:$DOCKER_IMAGE_VERSION