diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 02822bb..4c3a301 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -76,4 +76,28 @@ jobs: push: true tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}:latest cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max \ No newline at end of file + cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max + + update-gitops: + name: Update gitops repository + runs-on: ubuntu-latest + + steps: + - name: Checkout gitops repository + uses: actions/checkout@v4 + with: + repository: isd-sgcu/isd-gitops + token: ${{ secrets.GITOPS_TOKEN }} + + - name: Update image tag + uses: mikefarah/yq@master + env: + NEW_TAG: ${{ github.ref_type == 'tag' && github.ref_name || env.IMAGE_TAG }} + with: + cmd: yq -i '.auth.imageTag = strenv(NEW_TAG)' projects/johnjud/values/auth-dev.values.yaml + + - name: Commit & Push changes + uses: actions-js/push@v1.4 + with: + github_token: ${{ secrets.GITOPS_TOKEN }} + repository: isd-sgcu/isd-gitops \ No newline at end of file