From 330f2ccfdcd2005144c46244cadc707e4a511c75 Mon Sep 17 00:00:00 2001 From: Bandish Shah Date: Mon, 27 Nov 2023 20:27:56 -0800 Subject: [PATCH] Update Docker image release logic so that we can release new images to prod from workflow_dispatch --- .github/workflows/docker.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 13a835356c..f6dac79fe5 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -69,19 +69,17 @@ jobs: GIT_SHA=$(echo ${{ github.sha }} | cut -c1-7) echo "IMAGE_TAG=${GIT_SHA}" >> ${GITHUB_ENV} - if [ "${{ github.event_name }}" == "push" ]; then - echo "Triggered by push event." - PROD_REPO="mosaicml/llm-foundry" - IMAGE_TAG="${PROD_REPO}:${{matrix.name}}-${GIT_SHA},${PROD_REPO}:${{matrix.name}}-latest" - IMAGE_CACHE="${PROD_REPO}:${{matrix.name}}-buildcache" - elif [ "${{ github.event_name }}" == "pull_request" ]; then + if [ "${{ github.event_name }}" == "pull_request" ]; then echo "Triggered by pull_request event." STAGING_REPO="mosaicml/ci-staging" IMAGE_TAG="${STAGING_REPO}:${{matrix.name}}-${GIT_SHA}" IMAGE_CACHE="${STAGING_REPO}:${{matrix.name}}-buildcache" else - echo "Triggered by unknown event: ${{ github.event_name }}" - exit 1 + # Triggered by push or workflow_dispatch event + echo "Triggered by ${{ github.event_name }} event, releasing to prod" + PROD_REPO="mosaicml/llm-foundry" + IMAGE_TAG="${PROD_REPO}:${{matrix.name}}-${GIT_SHA},${PROD_REPO}:${{matrix.name}}-latest" + IMAGE_CACHE="${PROD_REPO}:${{matrix.name}}-buildcache" fi echo "IMAGE_TAG=${IMAGE_TAG}" >> ${GITHUB_ENV}