forked from bcgov/NotifyBC
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.56 KB
/
chartReleaser.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
name: Release Charts
on:
release:
types:
- published
pull_request:
paths:
- 'helm/**'
workflow_dispatch:
inputs:
chart_version:
description: 'The chart pre-release version label to create. Will be appended to the current version from helm/Chart.yaml (eg. Entering "pr36" with a helm/Chart.yaml at version 5.1.2 produces the final chart tag "5.1.2-pr36").'
required: true
jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
env:
CHART_VERSION: "${{ (github.event_name == 'workflow_dispatch' && format('-{0}', github.event.inputs.chart_version)) || (github.event_name == 'pull_request' && format('-pr{0}', github.event.pull_request.number)) }}"
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get helm chart version
id: chart
run: "echo \"version=$(helm show chart helm | grep 'version:' | tail -1 | cut -f2 -d' ')\" >> $GITHUB_OUTPUT"
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
charts_dir: ./
branch: gh-pages
target_dir: helm
chart_version: ${{ format('{0}{1}', steps.chart.outputs.version, (env.CHART_VERSION != 'false' && env.CHART_VERSION || '')) }}