From 9afe79b651896eecc48b68bdeb8c732bd166ab58 Mon Sep 17 00:00:00 2001 From: Shizun Ge Date: Wed, 27 Oct 2021 00:48:47 -0700 Subject: [PATCH] Add the release tag to the docker image --- .github/workflows/docker-hub-build-push.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub-build-push.yml b/.github/workflows/docker-hub-build-push.yml index 8dd1e1c..c3a717f 100644 --- a/.github/workflows/docker-hub-build-push.yml +++ b/.github/workflows/docker-hub-build-push.yml @@ -18,8 +18,14 @@ jobs: version: latest - name: login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: build the image + - name: build and push the latest image run: | docker buildx build --push \ --tag shizunge/endlessh-go:latest \ --platform linux/amd64,linux/arm/v7,linux/arm64 . + - name: extract tag string + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: tag image + run: docker tag shizunge/endlessh-go:latest shizunge/endlessh-go:$RELEASE_VERSION + - name: push tagged image + run: docker push shizunge/endlessh-go:$RELEASE_VERSION