-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (54 loc) · 1.8 KB
/
publish.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
## Reference: https://github.com/helm/chart-releaser-action
name: Chart Publish
on:
push:
branches:
- main
paths:
- "charts/**"
permissions:
contents: read
jobs:
publish:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install Helm
uses: azure/[email protected]
with:
version: v3.10.1
- name: Add helm repo
run: |
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
- name: Helm build
run: |
changed_helm_packages=$(git diff --name-only HEAD~1 | grep '^charts/' | cut -d/ -f1-2)
echo $changed_helm_packages
while IFS=$'\n' read -r package_directory; do
helm dependency build $package_directory || true
helm package $package_directory || true
done <<< "$changed_helm_packages"
- name: checkout gh-pages branch and helm index
run: |
git checkout gh-pages --
helm repo index .
- name: Commit The Chart Realease
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ github.event.head_commit.message }}
commit_options: '--no-verify --signoff'
branch: gh-pages
skip_checkout: true
repository: .
commit_user_name: XQUARE GitOps Bot
commit_user_email: [email protected]
commit_author: XQUARE GitOps Bot <[email protected]>