Skip to content

fix(helm): update chart cert-manager to v1.13.1 #9

fix(helm): update chart cert-manager to v1.13.1

fix(helm): update chart cert-manager to v1.13.1 #9

---
name: "HelmRepository Sync"
on:
workflow_dispatch:
inputs:
repoName:
description: Flux HelmRepository Name
required: true
repoNamespace:
description: Flux HelmRepository Namespace
default: flux-system
required: true
pull_request:
branches: ["main"]
paths: ["kubernetes/**/helmrelease.yaml"]
jobs:
sync:
name: Flux HelmRepository Sync
runs-on: ["arc-runner-set-home-ops"]
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Setup Kube Tools
uses: yokawasa/action-setup-kube-tools@af4ebb1af1efd30c5bd84a2e9773355ad6362a33 # v0.9.3
with:
setup-tools: yq
- name: Setup Flux
uses: fluxcd/flux2/action@026ab61ba7e3755d7be7dc7d2b6024c3b3992291 # v2.1.1
- name: Write kubeconfig
id: kubeconfig
uses: timheuer/base64-to-file@ca9e30baf83f7f26708fb0059af9a0973fe5f27e # v1.2
with:
encodedString: "${{ secrets.KUBECONFIG }}"
fileName: kubeconfig
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 # v39.2.0
with:
files: kubernetes/**/helmrelease.yaml
- name: Sync HelmRepository
env:
KUBECONFIG: "${{ steps.kubeconfig.outputs.filePath }}"
shell: bash
run: |
declare -a repos=()
for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do
repoName="$(yq eval '.spec.chart.spec.sourceRef.name' "${file}")"
repoNamespace="$(yq eval '.spec.chart.spec.sourceRef.namespace' "${file}")"
repos+=("${repoName}:${repoNamespace}")
done
repos=($(for r in ${repos[@]}; do echo $r; done | sort -u))
for repo in ${repos[@]}; do
flux --namespace "${repo##*:}" reconcile source helm "${repo%%:*}"
done
- if: ${{ github.event.inputs.repoName != '' }}
name: Sync HelmRepository
env:
KUBECONFIG: ${{ steps.kubeconfig.outputs.filePath }}
shell: bash
run: |
flux --namespace ${{ github.event.inputs.repoNamespace }} reconcile \
source helm ${{ github.event.inputs.repoName }}