-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (38 loc) · 1.42 KB
/
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
name: Release Charts
on:
push:
branches:
- main
workflow_dispatch: # click the button on Github repo!
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Update dependecy
run: |
helm repo add prometheus https://prometheus-community.github.io/helm-charts
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Copy README.md files to gh-pages
run: |
existing_worktree=$(git worktree list --porcelain | grep -B 2 "branch refs/heads/gh-pages" | head -n 1 | cut -d ' ' -f 2)
if [[ $existing_worktree != "" ]]; then git worktree remove -f $existing_worktree; fi
tmp_folder=$(mktemp -d)
git worktree add ${tmp_folder} gh-pages
rm -f -r ${tmp_folder}/charts
cp -r charts ${tmp_folder}/
pushd ${tmp_folder}
git add -A "charts/**/README.md"
git add -A "charts/**/values.yaml"
git pull origin gh-pages && git commit -m "Updating README.md and values files" && git push origin gh-pages
popd