Skip to content

Commit 9722451

Browse files
committed
updated pipeline to push new image tag to helm values
1 parent 1f6ad83 commit 9722451

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/ci-pipeline.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
update-helm:
7171
needs: build
7272
runs-on: self-hosted
73-
73+
7474
steps:
7575
- name: Checkout Helm Charts
7676
uses: actions/checkout@v3
@@ -83,11 +83,15 @@ jobs:
8383
- name: Ensure main branch is up to date
8484
run: git pull origin main
8585

86+
- name: Install yq
87+
run: |
88+
sudo apt-get update -y
89+
sudo apt-get install -y yq
90+
8691
- name: Update image tag
8792
run: |
8893
echo "Updating image tag to $IMAGE_TAG..."
89-
# Using sed - works on any system
90-
sed -i 's/^\([[:space:]]*tag:[[:space:]]*\).*/\1'"$IMAGE_TAG"'/' ./helm/application/values.yaml
94+
yq w -i ./helm/application/values.yaml 'app.image.tag' "$IMAGE_TAG"
9195
echo "Updated Helm values.yaml:"
9296
cat ./helm/application/values.yaml
9397
env:
@@ -97,4 +101,4 @@ jobs:
97101
run: |
98102
git add ./helm/application/values.yaml
99103
git commit -m "Update Flask App image tag to $IMAGE_TAG" || echo "No changes to commit"
100-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main
104+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main

0 commit comments

Comments
 (0)