Skip to content

Commit 7d72e32

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

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

.github/workflows/ci-pipeline.yaml

Lines changed: 5 additions & 9 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,15 +83,11 @@ 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-
91-
- name: Update image tag
86+
- name: Update image tag using sed
9287
run: |
9388
echo "Updating image tag to $IMAGE_TAG..."
94-
yq w -i ./helm/application/values.yaml 'app.image.tag' "$IMAGE_TAG"
89+
# Using sed - universal and reliable
90+
sed -i 's/^\([[:space:]]*tag:[[:space:]]*\).*/\1'"$IMAGE_TAG"'/' ./helm/application/values.yaml
9591
echo "Updated Helm values.yaml:"
9692
cat ./helm/application/values.yaml
9793
env:
@@ -101,4 +97,4 @@ jobs:
10197
run: |
10298
git add ./helm/application/values.yaml
10399
git commit -m "Update Flask App image tag to $IMAGE_TAG" || echo "No changes to commit"
104-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main
100+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main

0 commit comments

Comments
 (0)