Skip to content

Commit 21a40e3

Browse files
committed
Add GitHub Action for charts
1 parent 13c8a95 commit 21a40e3

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

.github/workflows/lint-test.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v3
16+
with:
17+
version: v3.12.1
18+
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.10'
22+
check-latest: true
23+
24+
- name: Set up chart-testing
25+
uses: helm/[email protected]
26+
27+
- name: Run chart-testing (list-changed)
28+
id: list-changed
29+
run: |
30+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
31+
if [[ -n "$changed" ]]; then
32+
echo "changed=true" >> "$GITHUB_OUTPUT"
33+
fi
34+
35+
- name: Run chart-testing (lint)
36+
if: steps.list-changed.outputs.changed == 'true'
37+
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
38+
39+
- name: Create kind cluster
40+
if: steps.list-changed.outputs.changed == 'true'
41+
uses: helm/[email protected]
42+
43+
- name: Run chart-testing (install)
44+
if: steps.list-changed.outputs.changed == 'true'
45+
run: ct install --target-branch ${{ github.event.repository.default_branch }}

.github/workflows/release.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
11+
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "[email protected]"
25+
26+
- name: Install Helm
27+
uses: azure/setup-helm@v3
28+
29+
- name: Run chart-releaser
30+
uses: helm/[email protected]
31+
env:
32+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/sync-readme.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches:
4+
- 'main'
5+
paths:
6+
- 'README.md'
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- run: |
13+
cp -f README.md ${{ runner.temp }}/README.md
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: gh-pages
17+
- run: |
18+
cp -f ${{ runner.temp }}/README.md .
19+
git config user.name "$GITHUB_ACTOR"
20+
git config user.email "[email protected]"
21+
git add README.md
22+
git commit --signoff -m "Sync README from main"
23+
git push

0 commit comments

Comments
 (0)