From 77add95e14e9594bd5776676b0c16ce94bc3fc6b Mon Sep 17 00:00:00 2001 From: qypol342 Date: Sun, 10 Nov 2024 11:43:15 +0100 Subject: [PATCH] better ci run condition --- .github/workflows/docker.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dfa47e7..e0c3b2d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 @@ -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 @@ -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 \ No newline at end of file + cache-to: type=gha,mode=max