only tag proper releases as latest

This commit is contained in:
Frederik Ring 2021-08-22 20:16:24 +02:00
parent d195e8967f
commit 935de92f2e

View File

@ -43,10 +43,13 @@ jobs:
docker context create docker-volume-backup
docker buildx create docker-volume-backup --name docker-volume-backup --use
docker buildx inspect --bootstrap
tag_args="-t offen/docker-volume-backup:$CIRCLE_TAG"
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# prerelease tags like `v2.0.0-alpha.1` should not be released as `latest`
tag_args="$tag_args -t offen/docker-volume-backup:latest"
fi
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \
-t offen/docker-volume-backup:$CIRCLE_TAG \
-t offen/docker-volume-backup:latest \
. --push
$tag_args . --push
workflows:
version: 2