update github action

This commit is contained in:
ginuerzh 2022-01-10 23:26:59 +08:00
parent 9fc2b8b675
commit c8006cc325

View File

@ -19,13 +19,12 @@ jobs:
run: | run: |
DOCKER_IMAGE=${{ secrets.DOCKER_IMAGE }} DOCKER_IMAGE=${{ secrets.DOCKER_IMAGE }}
VERSION=latest VERSION=latest
SHORTREF=${GITHUB_SHA::8}
# If this is git tag, use the tag name as a docker tag # If this is git tag, use the tag name as a docker tag
if [[ $GITHUB_REF == refs/tags/* ]]; then if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v} VERSION=${GITHUB_REF#refs/tags/v}
fi fi
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" TAGS="${DOCKER_IMAGE}:${VERSION}"
# If the VERSION looks like a version number, assume that # If the VERSION looks like a version number, assume that
# this is the most recent version of the image and also # this is the most recent version of the image and also