Skip to content

Commit

Permalink
feat: add auto imagetag change
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Feb 16, 2024
1 parent c68bbdb commit 76fc556
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 '.gateway.imageTag = strenv(NEW_TAG)' projects/johnjud/values/gateway-dev.values.yaml

- name: Commit & Push changes
uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GITOPS_TOKEN }}
repository: isd-sgcu/isd-gitops

0 comments on commit 76fc556

Please sign in to comment.