From 2a9c00071d7207c3caf1f493e50c32553ecb43aa Mon Sep 17 00:00:00 2001 From: wayne liu Date: Mon, 25 Nov 2024 15:03:34 +0800 Subject: [PATCH] change image generation policy --- .github/workflows/docker-image.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 52dd48e3..cf658db0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -39,10 +39,10 @@ jobs: - name: Set Docker image tag id: tag run: | - if [ "${{ github.event_name }}" == "schedule" ]; then + if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.ref }}" == "refs/heads/main" ]; then echo "TAGS=opencsg/csghub-server:latest,${{ secrets.ACR_REGISTRY }}/opencsg_public/csghub_server:latest" >> $GITHUB_ENV - else - echo "TAGS=opencsg/csghub-server:latest,opencsg/csghub-server:${GITHUB_REF_NAME},${{ secrets.ACR_REGISTRY }}/opencsg_public/csghub_server:latest,${{ secrets.ACR_REGISTRY }}/opencsg_public/csghub_server:${GITHUB_REF_NAME}" >> $GITHUB_ENV + elif [ "${{ github.event_name }}" == "push" ]; then + echo "TAGS=opencsg/csghub-server:${GITHUB_REF_NAME},${{ secrets.ACR_REGISTRY }}/opencsg_public/csghub_server:${GITHUB_REF_NAME}" >> $GITHUB_ENV fi - name: Build and push Docker image