-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (81 loc) · 2.44 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
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
name: Release Charts
on:
push:
branches:
- master
jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)
runs-on: ubuntu-latest
outputs:
changed_charts: ${{ steps.chart-releaser.outputs.changed_charts }}
chart_version: ${{ steps.chart-releaser.outputs.chart_version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.9.2
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1
id: chart-releaser
env:
CR_TOKEN: "${{ github.token }}"
generate-page:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to commit the generated file
needs:
- release
if: needs.release.outputs.changed_charts != ''
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: Generate Helm Charts HTML
uses: ./.github/actions/generate-helm-html-index
with:
index_file: 'index.yaml'
output_file: 'index.html'
- name: Commit and Push
run: |
git config --local user.email "$GITHUB_ACTOR"
git config --local user.name "[email protected]"
git add index.html
git commit -m "Update Helm charts page version: ${{ needs.release.outputs.changed_charts }}" || exit 0 # Don't fail if no changes
git push
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
id-token: write # Needed to deploy to GitHub Pages
pages: write
needs:
- generate-page
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4