Skip to content

Commit

Permalink
CI: add latest tag only for version releases
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothkannans committed Nov 12, 2024
1 parent 9607977 commit 72926d0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/docker-hub-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Docker Hub Build
on:
push:
tags:
- tests-passed
- 'tests-passed'
- 'v*'

concurrency:
group: build-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}
Expand All @@ -14,7 +15,7 @@ env:

jobs:
build:
if: startsWith(github.ref, 'refs/tags/tests-passed')
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
Expand All @@ -30,6 +31,7 @@ jobs:

- name: Docker meta
id: meta
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/metadata-action@v5
with:
images: vinkas/lauth
Expand All @@ -41,8 +43,17 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push tests-passed
if: startsWith(github.ref, 'refs/tags/tests-passed')
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: vinkas/lauth:tests-passed
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 72926d0

Please sign in to comment.