-
-
Notifications
You must be signed in to change notification settings - Fork 233
98 lines (87 loc) · 3.03 KB
/
publish-charts.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release Charts
on:
push:
paths:
- 'charts/**'
- '.github/workflows/publish-charts.yaml'
branches:
- master
jobs:
release-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/redis-operator"
path: "redis-operator"
fetch-depth: 0
- name: Checkout helm-charts
uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/helm-charts"
# use token for helm-charts repo
token: "${{ secrets.HELM_CHARTER_TOKEN }}"
path: "helm-charts"
fetch-depth: 0
- name: Get chart version
run: |
echo "chart_version=$(echo ${GITHUB_REF##*/v})" >> $GITHUB_ENV
- name: Install Helm
uses: azure/[email protected]
- name: Make charts
shell: bash
working-directory: redis-operator
run: |
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm dependency update charts/redis-operator
helm package charts/redis-operator -d .cr-release-packages
- name: Install chart-releaser
uses: helm/[email protected]
with:
install_only: true
# upload charts to helm-charts repos's release
- name: Upload charts
shell: bash
working-directory: redis-operator
run: |
cr upload
env:
# GitHub repository
CR_GIT_REPO: "helm-charts"
# Path to directory with chart packages (default ".cr-release-packages")
CR_PACKAGE_PATH: ".cr-release-packages"
# use token for helm-charts repo
CR_TOKEN: "${{ secrets.HELM_CHARTER_TOKEN }}"
# owner
CR_OWNER: "${{ github.repository_owner }}"
# skip existing charts
CR_SKIP_EXISTING: "true"
# copy artifacts to helm-charts repo, we need those for update index
- name: Copy artifacts
run: |
cp -r redis-operator/.cr-release-packages helm-charts/
- name: Configure Git
working-directory: helm-charts
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# this step will directly push to the main branch, so make sure you have the right permissions
- name: Update index
working-directory: helm-charts
run: |
cr index --push
env:
# GitHub repository
CR_GIT_REPO: "helm-charts"
# The GitHub pages branch (default "gh-pages")
CR_PAGES_BRANCH: "gh-pages"
# Path to directory with chart packages (default ".cr-release-packages")
CR_PACKAGE_PATH: ".cr-release-packages"
# use token for helm-charts repo
CR_TOKEN: "${{ secrets.HELM_CHARTER_TOKEN }}"
# owner
CR_OWNER: "${{ github.repository_owner }}"
# index path
CR_INDEX_PATH: "index.yaml"