Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 58f996c

Browse files
committed
Invoke on branch push and check version change
Signed-off-by: Charalampos Mainas <[email protected]>
1 parent cabe7aa commit 58f996c

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

Diff for: .github/workflows/build-trigger.yml

+4-17
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
name: 🍜 Build/publish go runners
22

33
on:
4-
pull_request:
5-
branches: ["main"]
64
push:
7-
branches: ["main", "staging"]
5+
branches: ["cm_add_runner"]
86
workflow_dispatch: # build on demand
9-
#schedule:
10-
# - cron: "43 6 * * 0" # build every Sunday at 6:43 AM UTC
117

128
concurrency:
139
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -46,6 +42,7 @@ jobs:
4642
- name: Show Changed Files
4743
run: |
4844
echo "Files in dockerfile: ${{ steps.filter.outputs.dockerfile_files }}"
45+
echo "Files for version: ${{ steps.filter.outputs.version_files }}"
4946
echo "Files in go: ${{ steps.filter.outputs.go_files }}"
5047
echo "dockerfile: ${{ steps.filter.outputs.dockerfile}}"
5148
echo "version: ${{ steps.filter.outputs.version}}"
@@ -54,21 +51,11 @@ jobs:
5451
build-pun:
5552
needs: [get-changed-files]
5653
name: Pun
57-
if: ${{ needs.get-changed-files.outputs.go == 'true' || needs.get-changed-files.outputs.dockerfile == 'true' }}
58-
uses: ./.github/workflows/build.yml
59-
secrets: inherit
60-
with:
61-
runner: '["gcc", "dind", "2204"]'
62-
runner-archs: '["amd64", "arm64"]'
63-
dockerfiles: ${{ toJSON(fromJSON(needs.get-changed-files.outputs.dockerfile_files || '[]')) }}
64-
65-
release-pun:
66-
needs: [get-changed-files]
67-
name: Pun
68-
if: ${{ needs.get-changed-files.outputs.version == 'true' }}
54+
if: ${{ needs.get-changed-files.outputs.go == 'true' || needs.get-changed-files.outputs.dockerfile == 'true' }} || ${{ needs.get-changed-files.outputs.version == 'true' }}
6955
uses: ./.github/workflows/build.yml
7056
secrets: inherit
7157
with:
7258
runner: '["gcc", "dind", "2204"]'
7359
runner-archs: '["amd64", "arm64"]'
7460
dockerfiles: ${{ toJSON(fromJSON(needs.get-changed-files.outputs.dockerfile_files || '[]')) }}
61+
version-tag: needs.get-changed-files.outputs.version

Diff for: .github/workflows/build.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
registry:
1919
type: string
2020
default: 'harbor.nbfc.io'
21+
version-tag:
22+
type: boolean
23+
default: false
2124
secrets:
2225
GIT_CLONE_PAT:
2326
required: false
@@ -140,8 +143,8 @@ jobs:
140143
- name: Set Docker tag based on branch, PR or version
141144
id: tag
142145
run: |
143-
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
144-
echo "PR detected. Using version: $( cat VERSION )."
146+
if [[ ${{ inputs.registry }} == true ]]; then
147+
echo "Version change detected. Using version: $( cat VERSION )."
145148
echo "TAG=$( cat VERSION ) " >> $GITHUB_ENV
146149
elif [[ "${GITHUB_REF##*/}" == "main" ]]; then
147150
echo "TAG=staging" >> $GITHUB_ENV

0 commit comments

Comments
 (0)