From 49a686d5f037e69dee87b87ca72ab5eb0e7c22e0 Mon Sep 17 00:00:00 2001 From: rilesdun Date: Tue, 19 Sep 2023 01:20:15 +0000 Subject: [PATCH] chore: fixing tagging of docker images --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 142d277..454b8da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,6 +75,7 @@ jobs: commit_message: 'Deploy Bandit report to GitHub Pages' release: + needs: [pylint, bandit-scan] runs-on: ubuntu-latest steps: - name: Checkout code @@ -100,13 +101,21 @@ jobs: git add CHANGELOG.md git commit -m "chore: update CHANGELOG.md" || echo "No changes to commit" git push - needs: [pylint, bandit-scan] dockerhub_publish: + needs: [release] runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4.0.0 + + - name: Fetch all tags + run: git fetch --tags + + - name: Get the latest tag + id: get-latest-tag + run: | + echo "::set-output name=tag::$(git tag --sort=taggerdate | tail -1)" - name: Log into Docker Hub uses: docker/login-action@v3.0.0 @@ -125,6 +134,7 @@ jobs: uses: docker/metadata-action@v5.0.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: ${{ steps.get-latest-tag.outputs.tag }} - name: Build and push Docker image uses: docker/build-push-action@v5.0.0 @@ -138,4 +148,3 @@ jobs: - name: Log out from Docker Hub run: docker logout ${{ env.REGISTRY }} - needs: [release]