From 40f50e3a3f3be2f9bbd52e75b3232c612929dc36 Mon Sep 17 00:00:00 2001 From: Mohmamad Arab Date: Thu, 24 Feb 2022 22:46:08 +0000 Subject: [PATCH] Fix Docker image tagging --- .travis.yml | 8 ++++---- deploy.sh | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 837b3d4..dfb8d4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,13 @@ dist: xenial go: - 1.16.x deploy: +- provider: script + on: + tag: true + script: bash ./deploy.sh - provider: releases skip_cleanup: true token: $GH_TOKEN file: bin/squid-exporter on: tags: true -- provider: script - on: - branch: master - script: bash ./deploy.sh diff --git a/deploy.sh b/deploy.sh index 04b2654..dcb2887 100644 --- a/deploy.sh +++ b/deploy.sh @@ -6,5 +6,7 @@ IMAGE_TAG=${TRAVIS_TAG:-latest} docker --version docker build -t $IMAGE_NAME:$IMAGE_TAG . +docker tag $IMAGE_NAME:$IMAGE_TAG $IMAGE_NAME:latest echo $DOCKER_API_KEY | docker login -u boynux --password-stdin docker push $IMAGE_NAME:$IMAGE_TAG +docker push $IMAGE_NAME:latest