Skip to content

Commit 10c9678

Browse files
committed
Another way to trigger on tag/releases.
1 parent d0ab7dc commit 10c9678

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: build
22

33
on:
4+
release:
5+
types: [created]
46
push:
57
branches:
68
- main
7-
tags:
8-
- "v*" # Triggers on version tags like v1.0.0
99
pull_request:
1010
branches:
1111
- main

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
cache-to: type=gha,mode=max
4747

4848
- name: build and push docker image (push branch)
49-
if: ${{ github.event.workflow_run.event == 'push' && !startsWith(github.ref, 'refs/tags/') }}
49+
if: ${{ github.event.workflow_run.event == 'push' }}
5050
uses: docker/build-push-action@v3
5151
with:
5252
push: true
@@ -58,7 +58,7 @@ jobs:
5858
cache-to: type=gha,mode=max
5959

6060
- name: build and push docker image (push tag)
61-
if: ${{ github.event.workflow_run.event == 'push' && startsWith(github.ref, 'refs/tags/') }}
61+
if: ${{ github.event.workflow_run.event == 'release' }}
6262
uses: docker/build-push-action@v3
6363
with:
6464
push: true

0 commit comments

Comments
 (0)