Update Image with Kustomize #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Image with Kustomize | |
on: | |
workflow_dispatch: | |
inputs: | |
app: | |
description: 'Application' | |
required: true | |
type: choice | |
options: | |
- api | |
- grep | |
- web | |
- api-v0-shim | |
- sco-redirect | |
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 |