From e98580c2552824600e2c1802815ef34263af2705 Mon Sep 17 00:00:00 2001 From: Simon Stone Date: Thu, 4 Mar 2021 10:40:28 +0000 Subject: [PATCH] Fix Docker image build (#79) Signed-off-by: Simon Stone --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdf449c..fa5a7e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,15 +57,14 @@ jobs: run: shellcheck builders/*/bin/* - name: Build Docker image run: | - VERSION=$(git describe --exact-match --tags $(Build.SourceVersion) | sed 's/^v//') - docker build -t ibmcom/ibp-microfab:${VERSION} . - docker tag ibmcom/ibp-microfab:${VERSION} ibmcom/ibp-microfab:latest + docker build -t ibmcom/ibp-microfab:latest . - name: Publish Docker image to Docker Hub env: DOCKER_HUB_USER_NAME: ${{ secrets.DOCKER_HUB_USER_NAME }} DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} run: | - VERSION=$(git describe --exact-match --tags $(Build.SourceVersion) | sed 's/^v//') + VERSION=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//') + docker tag ibmcom/ibp-microfab:latest ibmcom/ibp-microfab:${VERSION} docker login -u ${DOCKER_HUB_USER_NAME} -p ${DOCKER_HUB_ACCESS_TOKEN} docker push ibmcom/ibp-microfab:${VERSION} docker push ibmcom/ibp-microfab:latest