Skip to content

Commit

Permalink
ci: Fixing Docker push
Browse files Browse the repository at this point in the history
  • Loading branch information
Vel-San committed Feb 22, 2024
1 parent d0d94e6 commit a28eaaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit a28eaaf

Please sign in to comment.