Skip to content

Commit

Permalink
Merge pull request #6 from rickselby/master
Browse files Browse the repository at this point in the history
Generate tags for all parts of the semantic version
  • Loading branch information
danmilleruk authored Feb 23, 2021
2 parents d902cb6 + 1e9e26b commit 6cf41d7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ jobs:
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
if (echo "${VERSION}" | grep -Eq '^([0-9]+)\.([0-9]+)\.([0-9]+)$'); then
TAGS=$(echo "${VERSION}" | sed -E "s/([0-9]+)\.([0-9]+)\.([0-9]+)$/\1.\2.\3 \1.\2 \1/g")
elif (echo "${VERSION}" | grep -Eq '^([0-9]+)\.([0-9]+)$'); then
TAGS=$(echo "${VERSION}" | sed -E "s/([0-9]+)\.([0-9]+)$/\1.\2 \1/g")
else
TAGS="${VERSION}"
fi
echo TAGS=$TAGS
for TAG in ${TAGS}; do
docker tag $IMAGE_NAME $IMAGE_ID:$TAG
docker push $IMAGE_ID:$TAG
done

0 comments on commit 6cf41d7

Please sign in to comment.