-
Notifications
You must be signed in to change notification settings - Fork 8
36 lines (33 loc) · 1.16 KB
/
replace_version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Replace version in k8s manifests on main tag push
on:
push:
tags:
- "v*.*.*"
jobs:
replace_version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: main
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Replace image version in k8s manifests
run: |
for file in k8s/*.yaml; do
sed -i "s|ghcr.io/bl4ko/netbox-ssot:v.*.*.*|ghcr.io/bl4ko/netbox-ssot:${{ github.ref_name }}|g" "$file"
done
- name: Commit and push changes
run: |
git config --global user.name "svccicd"
git config --global user.email "[email protected]"
git add .
git commit -m "chore(k8s): Replace version in k8s manifests"
git push -f