Skip to content

Commit 71d5d0a

Browse files
feat(helm): add github action for chart test and release (#66)
Signed-off-by: prateekpandey14 <[email protected]>
1 parent d43c30e commit 71d5d0a

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Chart Lint and Test
2+
3+
on:
4+
push:
5+
paths:
6+
- 'deploy/helm/**'
7+
branches:
8+
- master
9+
pull_request:
10+
paths:
11+
- 'deploy/helm/**'
12+
branches:
13+
- master
14+
15+
jobs:
16+
lint-test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Helm
25+
uses: azure/setup-helm@v1
26+
with:
27+
version: v3.4.0
28+
29+
- uses: actions/setup-python@v2
30+
with:
31+
python-version: 3.7
32+
33+
- name: Set up chart-testing
34+
uses: helm/[email protected]
35+
36+
- name: Run chart-testing (list-changed)
37+
id: list-changed
38+
run: |
39+
changed=$(ct list-changed --config ct.yaml)
40+
if [[ -n "$changed" ]]; then
41+
echo "::set-output name=changed::true"
42+
fi
43+
44+
- name: Run chart-testing (lint)
45+
run: ct lint --config ct.yaml
46+
47+
- name: Create kind cluster
48+
uses: helm/[email protected]
49+
if: steps.list-changed.outputs.changed == 'true'
50+
51+
- name: Run chart-testing (install)
52+
run: ct install --config ct.yaml
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
paths:
6+
- 'deploy/helm/**'
7+
branches:
8+
- master
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Configure Git
20+
run: |
21+
git config user.name "$GITHUB_ACTOR"
22+
git config user.email "[email protected]"
23+
24+
- name: Install Helm
25+
uses: azure/setup-helm@v1
26+
with:
27+
version: v3.4.0
28+
29+
- name: Run chart-releaser
30+
uses: helm/[email protected]
31+
env:
32+
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
33+
with:
34+
charts_dir: deploy/helm

ct.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# See https://github.com/helm/chart-testing#configuration
2+
remote: origin
3+
target-branch: master
4+
chart-dirs:
5+
- deploy/helm
6+
helm-extra-args: --timeout=500s

0 commit comments

Comments
 (0)