-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.93 KB
/
generate-manifests.yaml
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
58
59
60
61
62
63
64
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