-
Notifications
You must be signed in to change notification settings - Fork 166
64 lines (54 loc) · 1.88 KB
/
helm-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Helm release
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- 'charts/k6-operator/Chart.yaml'
jobs:
generate-chart-schema:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Make changes to the file
run: |
make helm-schema
- name: Git diff
id: git-diff
continue-on-error: true
run: |
git diff --exit-code
if [ $? -eq 0 ]; then
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: "Commit changes and make PR"
if: steps.git-diff.outputs.changes == 'true'
run: |
git checkout -b helm/schema-update
git add charts/k6-operator/values.schema.json
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "auto: generate schema json"
git push -u origin helm/schema-update
gh pr create --title "Helm schema update" -B main -H helm/schema-update --body "Auto-generated by Github Workflow"
# We're failing here, so that maintainer can review the PR and merge it. Then Helm release should be re-run.
echo "Review the PR with schema update and re-run Helm release."
exit 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
call-update-helm-repo:
needs:
- generate-chart-schema
uses: grafana/helm-charts/.github/workflows/update-helm-repo.yaml@main
with:
charts_dir: charts
cr_configfile: charts/cr.yaml
ct_configfile: charts/ct.yaml
helm_tag_prefix: helm
secrets:
github_app_id: ${{ secrets.K6_OPERATOR_HELM_RELEASE_APP_ID }}
github_app_pem: ${{ secrets.K6_OPERATOR_HELM_RELEASE_PEM_KEY }}