-
Notifications
You must be signed in to change notification settings - Fork 4
83 lines (70 loc) · 2.49 KB
/
helm_release.yml
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
name: Helm Release Workflow
on: push
# push:
# branches:
# - v2
# workflow_dispatch:
permissions: write-all
jobs:
helm-release:
runs-on: ubuntu-latest
name: Release Helm Chart
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config --global user.name "elimoshkovich"
git config --global user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
- name: Generate Random Semantic Version
id: random-version
run: echo "::set-output name=version::$(echo v0.$((1 + RANDOM % 9)).$((1 + RANDOM % 9)))-${{ github.run_number }}"
- name: Package Helm Chart
run: |
helm package --version ${{ steps.random-version.outputs.version }} ./helm
- name: Copy chart file
run: |
mkdir -p ./upload
cp ${{ github.workspace }}/pdp-${{ steps.random-version.outputs.version }}.tgz ./upload/
- name: Upload chart file
uses: actions/upload-artifact@v2
with:
name: pdp-${{ steps.random-version.outputs.version }}
path: ./upload
- name: Checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: pdp-${{ steps.random-version.outputs.version }}
- name: Update chart repo index in gh-pages branch
run: |
helm repo index --merge index.yaml .
git config --local user.email "[email protected]"
git config --local user.name "elimoshkovich"
git add .
git commit -m "feat: Update chart index with version ${{ steps.random-version.outputs.version }}"
git push https://elimoshkovich:${{ secrets.PAGES }}@github.com/permitio/sidecar.git HEAD:gh-pages
# - name: Run User chart-releaser
# uses: helm/[email protected]
# env:
# CR_TOKEN: "${{ secrets.PAGES }}"
# with:
# charts_dir: ./helm/Chart.yaml
# packages_with_index: true
# pages_branch: 'gh-pages'
# - name: Publish Helm charts
# uses: stefanprodan/helm-gh-pages@master
# with:
# token: ${{ secrets.PAGES }}
# charts_dir: ./helm
# charts_url: https://permitio.github.io
# owner: permitio
# repository: sidecar
# branch: gh-pages