Skip to content

Commit

Permalink
ci(actions): add automatic kustomization workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbeckmann committed Jan 28, 2025
1 parent 9da12af commit ed4d984
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/kustomize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Kustomize

on:
workflow_call:
inputs:
k8s-path:
type: string
description: 'Type: dev/stg/prod'
required: true

jobs:
kustomize:
name: kustomize
runs-on: ubuntu-latest
permissions:
contents: read
env:
APP: datawiz2
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
repository: leibniz-psychology/k8s-argocd-datawiz2-config
ref: main
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
persist-credentials: true
# path: config

- name: Setup Kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.6.1"

- name: Switch out image tag
run: |
cd ${{ inputs.k8s-path }}
kustomize edit set image crzpiddev.azurecr.io/${{ env.APP }}_php_fpm:${{ github.sha }}
kustomize edit set image crzpiddev.azurecr.io/${{ env.APP }}_spss:${{ github.sha }}
kustomize edit set image crzpiddev.azurecr.io/${{ env.APP }}_nginx:${{ github.sha }}
cat kustomization.yaml
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "tag(${{ inputs.k8s-path }}): update "${{ github.sha }}""
- name: Git push
uses: ad-m/github-push-action@master
with:
repository: leibniz-psychology/k8s-argocd-datawiz2-config
ssh: true
branch: main
9 changes: 8 additions & 1 deletion .github/workflows/wf-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ jobs:
with:
container-tag: latest-dev
build-stage: dev
secrets: inherit
secrets: inherit

call-kustomize-workflow:
needs:
- call-container-build-workflow
with:
k8s-path: dev
secrets: inherit

0 comments on commit ed4d984

Please sign in to comment.