From b508e6593de4e419474e8a654e53ae695dee8e6a Mon Sep 17 00:00:00 2001 From: Bei Chu <914745487@qq.com> Date: Wed, 18 Jan 2023 17:18:50 +0800 Subject: [PATCH] chore: Tag preleases as `dev` and releases as `latest` (#659) --- .github/workflows/release.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7774b35f74..8f08872925 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -62,7 +62,7 @@ jobs: echo "::set-output name=version::$tag" echo "::set-output name=prerelease::false" else - echo "::set-output name=version::latest" + echo "::set-output name=version::dev" echo "::set-output name=prerelease::true" fi release: @@ -165,6 +165,14 @@ jobs: docker build -f ci/Dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + - name: Update latest image if releasing + if: (!needs.prepare.outputs.prerelease) && (matrix.os == 'ubuntu-20.04') + env: + IMAGE_TAG: ${{ needs.prepare.outputs.version }} + run: | + docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest + docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest + - name: Discord notification env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_HOOK }}