Skip to content

Commit 53239f1

Browse files
committed
Add Chart Release workflow
Signed-off-by: jaehanbyun <[email protected]>
1 parent 77aa2a0 commit 53239f1

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Push Helm Chart
2+
3+
on:
4+
push:
5+
paths:
6+
- 'charts/**'
7+
branches:
8+
- main
9+
10+
env:
11+
CHART_PATH: ./charts/redis-operator
12+
GH_PAGE_PATH: charts-gh-pages
13+
14+
jobs:
15+
update-chart:
16+
permissions:
17+
contents: write
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Helm
24+
uses: azure/setup-helm@v3
25+
with:
26+
version: v3.16.1
27+
28+
- name: Update Helm dependencies
29+
run: |
30+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
31+
helm repo add grafana https://grafana.github.io/helm-charts
32+
helm repo update
33+
helm dependency update ${{ env.CHART_PATH }}
34+
35+
- name: Package Helm Chart
36+
run: |
37+
helm package ${{ env.CHART_PATH }}
38+
39+
- name: Checkout charts-gh-pages
40+
uses: actions/checkout@v4
41+
with:
42+
ref: ${{ env.GH_PAGE_PATH }}
43+
path: ${{ env.GH_PAGE_PATH }}
44+
token: ${{ secrets.GIT_TOKEN }}
45+
46+
- name: Update Helm repo index
47+
run: |
48+
mv *.tgz ${{ env.GH_PAGE_PATH }}/
49+
helm repo index ${{ env.GH_PAGE_PATH }} --url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ --merge ${{ env.GH_PAGE_PATH }}/index.yaml
50+
51+
- name: Commit and Push to charts-gh-pages
52+
run: |
53+
cd ${{ env.GH_PAGE_PATH }}
54+
git config user.name "$GITHUB_ACTOR"
55+
git config user.email "[email protected]"
56+
git add .
57+
git commit -m "Update Helm chart for Redis Operator"
58+
git push origin ${{ env.GH_PAGE_PATH }}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}

0 commit comments

Comments
 (0)