Skip to content

Commit

Permalink
Commit only once
Browse files Browse the repository at this point in the history
  • Loading branch information
unkhz committed Jul 19, 2024
1 parent 33cefea commit c4ed04c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,28 @@ jobs:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
needs: build-package-images

strategy:
matrix:
kustomization:
- ./packages/base-node/.khz-k3s/kustomization.yaml
- ./packages/archive/.khz-k3s/kustomization.yaml

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install yq
uses: mikefarah/yq@master
with:
cmd: yq --version

- name: Update image version tag
- name: Update version tags
run: |
function update_version_tag() {
file=$1
yq e '.images[0].newTag = "${{ github.sha }}"' -i $file
git add $kustomization
}
update_version_tag ./packages/base-node/.khz-k3s/kustomization.yaml
update_version_tag ./packages/archive/.khz-k3s/kustomization.yaml
- name: Deploy
run: |
git config --global user.email "juhani.pelli@gmail.com"
git config --global user.name "Juhani Pelli"
yq e '.images[0].newTag = "${{ github.sha }}"' -i ${{ matrix.kustomization }}
git add ${{ matrix.kustomization }}
git commit -m "Deploy ${{ github.sha }} [skip ci]"
git push origin ${{ github.event.repository.default_branch }}

0 comments on commit c4ed04c

Please sign in to comment.