Skip to content

Commit

Permalink
better ci run condition
Browse files Browse the repository at this point in the history
  • Loading branch information
loan-mgt committed Nov 10, 2024
1 parent eeeab93 commit 77add95
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: Create, test, and publish a Docker image

on:
push:
branches:
- '**' # Run on every push to any branch
tags:
- '**' # Pattern matched against refs/tags
- 'v*' # Run on every push to tags that start with 'v'

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -76,6 +78,7 @@ jobs:
name: Publish Docker image
runs-on: ubuntu-latest
needs: test-image # Run only after test-image job completes successfully
if: startsWith(github.ref, 'refs/tags/v') # Only run if a tag starting with 'v' is pushed

steps:
- name: Checkout repository
Expand All @@ -96,4 +99,4 @@ jobs:
push: true # Push the image in this step
tags: ${{ needs.build-image.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max

0 comments on commit 77add95

Please sign in to comment.