-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 1.48 KB
/
set-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update Image with Kustomize
on:
workflow_dispatch:
inputs:
app:
description: 'Application'
required: true
type: choice
options:
- api
- grep
- web
- api-v0-shim
environment:
description: 'Environment'
default: prod
type: choice
options:
- prod
- stage
base-tag:
description: 'Base Image Tag'
type: string
tag:
description: 'Image Tag'
required: true
type: string
jobs:
update-image:
runs-on: ubuntu-latest
steps:
- name: Generate Auth Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- id: git-user
name: Set up git user
uses: haarg/setup-git-user@v1
with:
app: ${{ steps.app-token.outputs.app-slug }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Set up Kustomize
uses: imranismail/setup-kustomize@v2
- name: Update Image Tag
working-directory: ./apps/${{ inputs.app }}/environments/${{ inputs.environment }}
run: |
kustomize edit set image ${{ inputs.base-tag }} ${{ inputs.tag }}
git add .
git commit -m 'Update ${{ inputs.app }} to `${{ inputs.tag }}`'
- name: Push manifests
run: git push