Merge pull request #1032 from cubic3d/renovate/kubelet-csr-approver-1.x #5
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: Generate and update static manifests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- infrastructure/talos/**/kustomization.yaml | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Check out code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 2 | |
- name: Changed Files | |
uses: tj-actions/[email protected] | |
id: changed-files | |
with: | |
dir_names: true | |
json: true | |
files: infrastructure/talos/**/kustomization.yaml | |
- name: Set matrix | |
id: set-matrix | |
run: echo "matrix={\"dir\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" | |
generate: | |
runs-on: ubuntu-latest | |
needs: | |
- changes | |
strategy: | |
matrix: ${{ fromJSON(needs.changes.outputs.matrix) }} | |
fail-fast: false | |
env: | |
dir: ${{ matrix.dir }} | |
steps: | |
- name: Check out code | |
uses: actions/[email protected] | |
- name: Setup Kustomize | |
uses: imranismail/[email protected] | |
- name: Build manifests | |
id: build-manifests | |
run: | | |
echo "app=${dir##*/}" >> "$GITHUB_OUTPUT" | |
g=${dir%/*}; echo "cluster=${g##*/}" >> "$GITHUB_OUTPUT" | |
kustomize build ${{ matrix.dir }} --enable-helm -o "${{ matrix.dir }}/deploy.yaml" | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
branch: gen-manifest/${{ steps.build-manifests.outputs.cluster }}/${{ steps.build-manifests.outputs.app }} | |
delete-branch: true | |
commit-message: "cluster(${{ steps.build-manifests.outputs.cluster }}): generate ${{ steps.build-manifests.outputs.app }}" | |
title: Generate manifests for ${{ steps.build-manifests.outputs.app }} on ${{ steps.build-manifests.outputs.cluster }} | |
body: "" | |
labels: infrastructure/manifests |