-
Notifications
You must be signed in to change notification settings - Fork 51
48 lines (45 loc) · 1.51 KB
/
chart_release.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
name: Helm Chart Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
# Sometimes chart-releaser might fetch an outdated index.yaml from gh-pages, causing a WAW hazard on the repo
# This job checks the remote file is up to date with the local one on release
validate-gh-pages-index:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Download remote index file and check equality
run: |
curl -vsSL https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/index.yaml > index.yaml.remote
LOCAL="$(md5sum < index.yaml)"
REMOTE="$(md5sum < index.yaml.remote)"
echo "$LOCAL" = "$REMOTE"
test "$LOCAL" = "$REMOTE"
chart-release:
name: Create chart release
runs-on: ubuntu-latest
needs: [ validate-gh-pages-index ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Add bitnami repository
run: helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Release workload charts
uses: helm/[email protected]
with:
config: .github/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"