Skip to content

Commit

Permalink
chore: fixing tagging of docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
rilesdun committed Sep 19, 2023
1 parent 8a36b7c commit 49a686d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -138,4 +148,3 @@ jobs:

- name: Log out from Docker Hub
run: docker logout ${{ env.REGISTRY }}
needs: [release]

0 comments on commit 49a686d

Please sign in to comment.