-
Notifications
You must be signed in to change notification settings - Fork 3
156 lines (136 loc) · 4.62 KB
/
chart-workflow.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Lint, Test and Deploy Charts
on:
push:
paths:
- charts/**
- .github/workflows/**
pull_request:
paths:
- charts/**
- .github/workflows/**
jobs:
lint-charts:
name: Lint Charts
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v2.4.2
with:
fetch-depth: 0
- name: "Set Up Helm"
uses: azure/setup-helm@v3.3
if: github.ref != 'refs/heads/main'
with:
version: v3.4.1
- name: "Set Up Python"
uses: actions/setup-python@v4.2.0
if: github.ref != 'refs/heads/main'
with:
python-version: 3.9
- name: "Set up chart-testing"
uses: helm/chart-testing-action@v2.3.0
if: github.ref != 'refs/heads/main'
with:
version: v3.3.0
- name: "Run chart-testing (list-changed)"
id: list-changed
if: github.ref != 'refs/heads/main'
run: |
changed=$(ct list-changed --config .github/ct/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed-list=$changed" >> $GITHUB_OUTPUT
fi
- name: "Save Testing Values from Secret"
shell: bash
env:
SECRET_VALUES: ${{ secrets.FOUNDRY_SECRET_VALUES }}
run: echo "$SECRET_VALUES" | base64 -d > ./charts/foundry-vtt/ci/test-values.yaml
if: github.ref != 'refs/heads/main' && contains(steps.list-changed.outputs.changed-list, 'charts/foundry-vtt')
- name: "Run chart-testing (lint)"
run: ct lint --config .github/ct/ct.yaml --lint-conf .github/ct/lintconf.yaml --chart-yaml-schema .github/ct/chart_schema.yaml
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main'
install-charts:
name: Install Charts
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v2.4.2
with:
fetch-depth: 0
- name: "Set Up Helm"
uses: azure/setup-helm@v3.3
if: github.ref != 'refs/heads/main'
with:
version: v3.4.1
- name: "Set Up Python"
uses: actions/setup-python@v4.2.0
if: github.ref != 'refs/heads/main'
with:
python-version: 3.9
- name: "Set up chart-testing"
uses: helm/chart-testing-action@v2.3.0
if: github.ref != 'refs/heads/main'
with:
version: v3.3.0
- name: "Run chart-testing (list-changed)"
id: list-changed
if: github.ref != 'refs/heads/main'
run: |
changed=$(ct list-changed --config .github/ct/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed-list=$changed" >> $GITHUB_OUTPUT
fi
- name: "Save Testing Values from Secret"
shell: bash
env:
SECRET_VALUES: ${{ secrets.FOUNDRY_SECRET_VALUES }}
run: echo "$SECRET_VALUES" | base64 -d > ./charts/foundry-vtt/ci/test-values.yaml
if: github.ref != 'refs/heads/main' && contains(steps.list-changed.outputs.changed-list, 'charts/foundry-vtt')
- name: Create kind cluster
uses: helm/kind-action@v1.4.0
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main'
- name: Run chart-testing (install)
run: ct install --config .github/ct/ct.yaml --debug
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main'
release-on-github-pages:
name: Release Chart on GitHub Pages
runs-on: ubuntu-22.04
needs:
- lint-charts
- install-charts
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodule: recursive
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.1.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Build Hugo
run: |
git submodule init
git submodule update
cd hugo
hugo --minify
cp -r ./public ../public
cd ..
- name: Deploy Hugo
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: helm.mahahe.it
keep_files: true