-
Notifications
You must be signed in to change notification settings - Fork 17
95 lines (80 loc) · 2.6 KB
/
Copy pathci-chart.yaml
File metadata and controls
95 lines (80 loc) · 2.6 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Helm CI
on:
push:
branches:
- main
- release-*
paths:
- "deploy/charts/**"
pull_request:
paths:
- "deploy/charts/**"
jobs:
helm-lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4.3.1
with:
version: v3.17.0
- uses: actions/setup-python@v5.6.0
with:
python-version: "3.x"
check-latest: true
- name: Run docs-testing (helm-docs)
id: helm-docs
run: |
make helm-docs
if [[ $(git diff --stat) != '' ]]; then
echo -e '\033[0;31mDocumentation outdated! (Run make helm-docs locally and commit)\033[0m ❌'
git diff --color
exit 1
else
echo -e '\033[0;32mDocumentation up to date\033[0m ✔'
fi
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.8.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config=.github/ci/ct.yaml --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.13.0
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config=.github/ci/ct.yaml --target-branch ${{ github.event.repository.default_branch }}
release_helm:
runs-on: ubuntu-latest
if: |
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release-')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm on Runner
uses: azure/setup-helm@v4.3.1
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.7.0
with:
charts_dir: deploy/charts
skip_existing: true
env:
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"