From 18afd92fc3510a5b3ebac779ef68e1aa2baa8912 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 31 Jul 2020 21:32:06 +0200 Subject: [PATCH] Fixed how docker image version is extracted from github ref --- docker/build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/build b/docker/build index ace00bde..fdd58106 100755 --- a/docker/build +++ b/docker/build @@ -7,12 +7,13 @@ DOCKER_IMAGE="shlinkio/shlink" # If ref is not develop, then this is a tag. Build that docker tag and also "stable" if [[ "$GITHUB_REF" != *"develop"* ]]; then - TAGS="-t ${DOCKER_IMAGE}:${GITHUB_REF#?}" + VERSION=${GITHUB_REF#refs/tags/v} + TAGS="-t ${DOCKER_IMAGE}:${VERSION}" # Push stable tag only if this is not an alpha or beta tag [[ $GITHUB_REF != *"alpha"* && $GITHUB_REF != *"beta"* ]] && TAGS="${TAGS} -t ${DOCKER_IMAGE}:stable" docker buildx build --push \ - --build-arg SHLINK_VERSION=${GITHUB_REF#?} \ + --build-arg SHLINK_VERSION=${VERSION} \ --platform ${PLATFORMS} \ ${TAGS} .