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