Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 40d1fbf

Browse files
authored
Create k8s-deployment-scripts-update.yml
1 parent 418d187 commit 40d1fbf

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: k8s-deployment-scripts-update
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image:
7+
description: 'Image'
8+
required: true
9+
tag:
10+
description: 'Tag'
11+
required: true
12+
13+
jobs:
14+
# Print inputs
15+
print:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Pring inputs
19+
run: |
20+
echo ${{ inputs.image }}
21+
echo ${{ inputs.tag }}
22+
23+
# Update repo eipm/k8s-deployment-scripts if version starts with v
24+
update:
25+
runs-on: ubuntu-latest
26+
if: ${{ startsWith(inputs.tag, 'v') }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
with:
31+
path: k8s-deployment-scripts
32+
ref: main
33+
repository: eipm/k8s-deployment-scripts
34+
token: ${{ secrets.GHCR_TOKEN }}
35+
36+
- name: Update image
37+
run: |
38+
# Update the image version in the repo
39+
cd k8s-deployment-scripts
40+
echo DIRECTORY="$(pwd)"
41+
IMAGE=${{ inputs.image }}
42+
VERSION=$(echo ${{ inputs.tag }} | sed -e 's/^v//')
43+
echo IMAGE=$IMAGE
44+
echo VERSION=$VERSION
45+
find ./ -type f -exec sed -i '' -e 's|'$IMAGE':.*|'$IMAGE:$VERSION'|g' {} \;
46+
47+
- name: Commit and push to repo
48+
run: |
49+
cd k8s-deployment-scripts
50+
echo DIRECTORY="$(pwd)"
51+
git config --global user.name "eipmgithubsvc1"
52+
git config --global user.email "[email protected]"
53+
git commit -a -m "Updated image"
54+
git push

0 commit comments

Comments
 (0)