From 67b9c8a17377c387e1dfa7fea4ffb95695fd542e Mon Sep 17 00:00:00 2001 From: "Hui, Chunyang" Date: Fri, 11 Jun 2021 02:34:29 +0000 Subject: [PATCH] Update docker build actions to manual trigger --- .../workflows/build_and_push_docker_image.yml | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_push_docker_image.yml b/.github/workflows/build_and_push_docker_image.yml index 82104c6e..f7221561 100644 --- a/.github/workflows/build_and_push_docker_image.yml +++ b/.github/workflows/build_and_push_docker_image.yml @@ -1,14 +1,19 @@ name: Occlum Docker Build and Push -# Triggers the workflow on pre-release events +# This is a manual trigger. on: - release: - types: [prereleased] + workflow_dispatch: + inputs: + OS: + description: 'OS name (must choose from )' + required: true + default: 'ubuntu' jobs: generate-centos-image: # GitHub Actions doesn't have CentOS VM provided runs-on: ubuntu-18.04 + if: github.event.inputs.OS == 'centos' steps: - name: Prepare tools @@ -25,9 +30,8 @@ jobs: cp -r tools/toolchains . cp -r tools/docker . - - name: Get release version - id: get_version - run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV; + - name: Get Occlum release version + run: echo "RELEASE_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; - name: Get branch name # GITHUB_REF=refs/heads/branch-name @@ -61,6 +65,7 @@ jobs: generate-ubuntu-image: runs-on: ubuntu-18.04 + if: github.event.inputs.OS == 'ubuntu' steps: - name: Checkout code @@ -73,9 +78,8 @@ jobs: cp -r tools/toolchains . cp -r tools/docker . - - name: Get release version - id: get_version - run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV; + - name: Get Occlum release version + run: echo "RELEASE_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; - name: Get branch name # GITHUB_REF=refs/heads/branch-name