From 4c89e51d7a57aadeb3e9759dbfb2219a8a9d890d Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sat, 21 Aug 2021 21:02:34 +0100 Subject: [PATCH] Add docker latest tag for tagged releases --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be0200728..ffea61a9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,7 +75,7 @@ jobs: # Allows pushing to registry on localhost:5000 driver-opts: network=host - - name: Setup push rights to Docker Hub + - name: Setup push rights to Docker registry if: env.REGISTRY != 'localhost:5000' run: | docker login -u "${{ secrets.DOCKER_REGISTRY_USERNAME }}" -p "${{ secrets.DOCKER_REGISTRY_TOKEN }}" "${{ env.REGISTRY }}" @@ -89,6 +89,10 @@ jobs: if [ "${{ github.ref }}" == "refs/heads/main" ]; then TAGS="$TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main" fi + if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]; then + TAGS="$TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" + fi + echo "TAGS=$TAGS" echo "TAGS=$TAGS" >> $GITHUB_ENV