File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update Image with Kustomize
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ app :
6+ description : ' Application'
7+ required : true
8+ type : choice
9+ options :
10+ - api
11+ - grep
12+ - web
13+ environment :
14+ description : ' Environment'
15+ default : prod
16+ type : choice
17+ options :
18+ - prod
19+ - stage
20+ repository :
21+ description : ' Repository'
22+ required : true
23+ type : string
24+ tag :
25+ description : ' Tag'
26+ required : true
27+ type : string
28+
29+ jobs :
30+ update-image :
31+ runs-on : ubuntu-latest
32+
33+ steps :
34+ - name : Generate Auth Token
35+ id : auth-token
36+ uses : jamestrousdale/github-app-jwt-token@0.1.4
37+ with :
38+ app-id : ${{ secrets.APP_ID }}
39+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
40+ - id : git-user
41+ name : Set up git user
42+ uses : haarg/setup-git-user@v1
43+ with :
44+ jwt : ${{ steps.auth-token.outputs.jwt }}
45+ - uses : actions/checkout@v4
46+ with :
47+ token : ${{ steps.auth-token.outputs.access-token }}
48+ - name : Set up Kustomize
49+ uses : imranismail/setup-kustomize@v2
50+ - name : Update Image Tag
51+ working-directory : ./apps/${{ inputs.app }}/environments/${{ inputs.environment }}
52+ run : |
53+ kustomize edit set image "${{ inputs.repository }}:latest" "${{ inputs.repository }}:${{ inputs.tag }}"
54+ git add .
55+ git commit -m "Update ${{ inputs.app }} to ${{ github.sha }}"
56+ - name : Push manifests
57+ run : git push
You can’t perform that action at this time.
0 commit comments