diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e5f1f699de1..0fb2aac8c56 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,6 +32,11 @@ on: description: 'Publish Docker token' required: true type: string + publish-latest-tag: + description: 'Whether to publish the image to the Docker latest tag. This operation is only applicable to official releases and should not be used for Release Candidate (RC).' + required: false + type: boolean + default: false jobs: publish-docker-image: @@ -83,6 +88,12 @@ jobs: echo "image_type=iceberg-rest-server" >> $GITHUB_ENV echo "image_name=apache/gravitino-iceberg-rest" >> $GITHUB_ENV fi + + if [ "${{ github.event.inputs.publish-latest-tag }}" == "true" ]; then + echo "publish_latest=true" >> $GITHUB_ENV + else + echo "publish_latest=false" >> $GITHUB_ENV + fi - name: Check publish Docker token run: | @@ -115,8 +126,10 @@ jobs: sudo rm -rf /usr/local/lib/android sudo rm -rf /opt/hostedtoolcache/CodeQL - if [[ "${image_type}" == "gravitino" || "${image_type}" == "iceberg-rest-server" ]]; then + if [[ "${publish_latest}" == "true" ]]; then + echo "Publish latest tag" ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${{ github.event.inputs.version }} --latest else + echo "Doesn't publish latest tag" ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag "${tag_name}-${{ github.event.inputs.version }}" - fi \ No newline at end of file + fi