Skip to content

Commit

Permalink
ci(github-actions): adding action for updating image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ko committed Nov 11, 2024
1 parent 48836d4 commit a20e19c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/replace_version.yml
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 }}

0 comments on commit a20e19c

Please sign in to comment.