From f615dfa17cc1d207bff00027e224f6b02871f763 Mon Sep 17 00:00:00 2001 From: guobao2333 Date: Mon, 9 Sep 2024 13:57:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E5=8C=96=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=9E=84=E5=BB=BAaction=20+4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index c8a7351..f43a881 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -63,6 +63,14 @@ jobs: type=sha type=raw,value=latest + - name: Add tag based on condition + run: | + if [[ ${{ github.ref }} =~ refs/tags/v ]]; then + echo "##${{ github.event.ref }}" >> $GITHUB_OUTPUT + else + echo "##${{ github.event_time }}" >> $GITHUB_OUTPUT + fi + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image @@ -75,12 +83,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Add tag based on condition - run: | - if [[ ${{ github.ref }} =~ refs/tags/v ]]; then - echo "##${{ github.event.ref }}" >> $GITHUB_OUTPUT - else - echo "##${{ github.event_time }}" >> $GITHUB_OUTPUT - fi \ No newline at end of file + cache-to: type=gha,mode=max \ No newline at end of file