diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 98f30fe..2019806 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,6 @@ jobs: push: runs-on: ubuntu-latest - needs: build steps: @@ -63,4 +62,26 @@ jobs: context: . file: ./Dockerfile push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-web-app:${{github.run_id}} \ No newline at end of file + tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-web-app:${{github.run_id}} + + update-newtag-in-helm-chart: + runs-on: ubuntu-latest + needs: push + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.TOKEN }} + + - name: Update tag in Helm chart + run: | + sed -i 's/tag: .*/tag: "${{github.run_id}}"/' helm/go-web-app-chart/values.yaml + + - name: Commit and push changes + run: | + git config --global user.email "anmol.saini@hpe.com" + git config --global user.name "Anmol Saini" + git add helm/go-web-app-chart/values.yaml + git commit -m "Update tag in Helm chart" + git push \ No newline at end of file