-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github-actions): adding action for updating image tag
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Replace version in k8s manifests on main tag push | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
replace_version: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
if: endsWith(github.ref, 'main') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
with: | ||
persist-credentials: false | ||
|
||
|
||
- 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 }}|g" "$file" | ||
done | ||
- name: Commit changes | ||
run: | | ||
git config --global user.name "svccicd" | ||
git config --global user.email "187764736+svccicd@users.noreply.github.com" | ||
git add . | ||
git commit -m "chore(k8s): Replace version in k8s manifests" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |