-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.59 KB
/
update-helm-charts.yml
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
name: Update and Index Helm Charts
on:
repository_dispatch:
types: [new-helm-chart-version]
jobs:
cleanup:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Delete deployment
uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: github-pages
onlyRemoveDeployments: true
update-charts:
runs-on: ubuntu-latest
needs: cleanup
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
helm version
- name: Log In to Helm Registry
run: |
helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Fetch and Store New Chart
run: |
helm pull oci://ghcr.io/caas-team/charts/${{ github.event.client_payload.chart }} --version ${{ github.event.client_payload.version }}
- name: Update Index File
run: |
mkdir -p ${{ github.event.client_payload.chart }}
mv ${{ github.event.client_payload.chart }}*.tgz ${{ github.event.client_payload.chart }}
helm repo index --url https://caas-team.github.io/helm-charts/ .
git config user.name "github-actions"
git config user.email "[email protected]"
git add -A
git commit -m "Update Helm chart and index.yaml for ${{ github.event.client_payload.chart }}@${{ github.event.client_payload.version }}"
git push