Skip to content

Commit 8def74c

Browse files
committed
Commit only once
1 parent 33cefea commit 8def74c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/master.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,25 @@ jobs:
8181
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
8282
runs-on: ubuntu-latest
8383
needs: build-package-images
84-
85-
strategy:
86-
matrix:
87-
kustomization:
88-
- ./packages/base-node/.khz-k3s/kustomization.yaml
89-
- ./packages/archive/.khz-k3s/kustomization.yaml
90-
9184
steps:
9285
- name: Install yq
9386
uses: mikefarah/yq@master
9487
with:
9588
cmd: yq --version
9689

97-
- name: Update image version tag
90+
- name: Update version tags
91+
run: |
92+
function update_version_tag() {
93+
file=$1
94+
yq e '.images[0].newTag = "${{ github.sha }}"' -i $file
95+
git add $kustomization
96+
}
97+
update_version_tag ./packages/base-node/.khz-k3s/kustomization.yaml
98+
update_version_tag ./packages/archive/.khz-k3s/kustomization.yaml
99+
100+
- name: Deploy
98101
run: |
99102
git config --global user.email "juhani.pelli@gmail.com"
100103
git config --global user.name "Juhani Pelli"
101-
yq e '.images[0].newTag = "${{ github.sha }}"' -i ${{ matrix.kustomization }}
102-
git add ${{ matrix.kustomization }}
103104
git commit -m "Deploy ${{ github.sha }} [skip ci]"
104105
git push origin ${{ github.event.repository.default_branch }}

0 commit comments

Comments
 (0)