From a28eaaf593c17bb41b3ea4d7073bcccab553dfde Mon Sep 17 00:00:00 2001 From: Vel-San <13340023+Vel-San@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:26:18 +0100 Subject: [PATCH] ci: Fixing Docker push --- .github/workflows/docker-build-push.yml | 15 +++++++++------ README.md | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 59e8b40..b9f9b56 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -20,9 +20,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Fetch tags + run: git fetch --tags + - name: Get latest tag id: latest_tag - run: echo "::set-output name=TAG::$(git describe --abbrev=0 --tags || echo '')" + run: echo "TAG=$(git describe --abbrev=0 --tags || echo '')" >> "$GITHUB_ENV" - name: Login to Docker Hub uses: docker/login-action@v2 @@ -31,11 +34,11 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build Docker image - if: steps.latest_tag.outputs.TAG != '' - run: docker build -t vel7an/wbmbot_v2:${{ steps.latest_tag.outputs.TAG }} -t vel7an/wbmbot_v2:latest -f ci/docker/Dockerfile . + if: $TAG != '' + run: docker build -t vel7an/wbmbot_v2:${TAG} -t vel7an/wbmbot_v2:latest -f ci/docker/Dockerfile . - name: Push Docker image to Docker Hub - if: steps.latest_tag.outputs.TAG != '' + if: $TAG != '' run: | - docker push vel7an/wbmbot_v2:${{ steps.latest_tag.outputs.TAG }} - docker push vel7an/wbmbot_v2:latest + docker push vel7an/wbmbot_v2:${TAG} + docker push vel7an/wbmbot_v2:latest \ No newline at end of file diff --git a/README.md b/README.md index f66240b..3da9d33 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ![Code Format](https://img.shields.io/badge/CODE%20FORMAT-BLACK-black?style=flat-square&logo=python) -![Static Badge](https://img.shields.io/badge/BOT_VERSION-v1.0.0-teal?style=flat-square) +![GitHub Release](https://img.shields.io/github/v/release/vel-san/wbmbot_v2?sort=semver&display_name=tag&style=flat-square&logo=semver&label=BOT%20VERSION&color=teal) ![Alt](https://repobeats.axiom.co/api/embed/ab658dc363a9401ed4e7171a5442d8e1c1fe585b.svg "Repobeats analytics image")