diff --git a/.github/workflows/build_and_push_docker_image.yml b/.github/workflows/build_and_push_docker_image.yml index 50391885..abf10cc5 100644 --- a/.github/workflows/build_and_push_docker_image.yml +++ b/.github/workflows/build_and_push_docker_image.yml @@ -8,6 +8,10 @@ on: description: 'OS name (must choose from )' required: true default: 'ubuntu20' + release: + description: 'Whether it is a release image (must choose from )' + required: true + default: 'N' jobs: generate-centos-image: @@ -125,6 +129,13 @@ jobs: # ${GITHUB_REF##*/} == branch-name run: echo "OCCLUM_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV; + - name: Get image tag name for release image + if: github.event.inputs.release == 'Y' + run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV + - name: Get image tage name for dev image + if: github.event.inputs.release == 'N' + run: echo "IMAGE_TAG=latest-dev-${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -147,4 +158,4 @@ jobs: platforms: linux/amd64 build-args: OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }} push: true - tags: occlum/occlum:${{ env.RELEASE_VERSION }}-ubuntu20.04 + tags: occlum/occlum:${{ env.IMAGE_TAG }}-ubuntu20.04