Skip to content

Commit

Permalink
chore(ci): adding a latest tag to releases
Browse files Browse the repository at this point in the history
  • Loading branch information
madflojo committed May 25, 2024
1 parent 1eadcda commit dc3af62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: madflojo/tarmac:unstable
- name: Checkout code and fetch all tags
run: |
git fetch --tags
echo "current_tag=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
echo "latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
- name: Build and push (tag)
id: docker_build_tag
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -34,4 +39,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
# tag with the git tag v*
tags: madflojo/tarmac:${{ github.ref_name }}
tags: |
madflojo/tarmac:${{ github.ref_name }}
${{ env.latest_tag == env.current_tag && 'madflojo/tarmac:latest' }}

0 comments on commit dc3af62

Please sign in to comment.