Skip to content

Commit

Permalink
feat: add update gitops
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Feb 16, 2024
1 parent 6aba816 commit 88e0c4a
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,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
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 '.backend.imageTag = strenv(NEW_TAG)' projects/johnjud/values/backend-dev.values.yaml

- name: Commit & Push changes
uses: actions-js/push@v1.4
with:
github_token: ${{ secrets.GITOPS_TOKEN }}
repository: isd-sgcu/isd-gitops

0 comments on commit 88e0c4a

Please sign in to comment.