-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (38 loc) · 1.44 KB
/
helm.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
name: Helm
on:
push:
tags: ["*"]
pull_request:
jobs:
chart:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set the version (tag)
if: github.event_name == 'push'
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Set the the mock version (PR)
if: github.event_name == 'pull_request'
run: echo "VERSION=PR-${GITHUB_SHA}" >> $GITHUB_ENV
- name: Replace the version in Chart.yaml
run: |
sed -i "s/version: .*/version: $VERSION/" kubernetes/helm/Chart.yaml
- name: Print the changes
run: cat kubernetes/helm/Chart.yaml
- name: Replace image versions in values.yaml
run: |
sed -i "s/version: .*GHA/version: $VERSION/" kubernetes/helm/values.yaml
sed -i "s/wgVersion: .*GHA/wgVersion: $VERSION/" kubernetes/helm/values.yaml
sed -i "s/nginxVersion: .*GHA/nginxVersion: $VERSION/" kubernetes/helm/values.yaml
- name: Push Helm chart to registry
if: github.event_name != 'pull_request' # skip on PRs
uses: bsord/[email protected]
with:
useOCIRegistry: true
registry-url: oci://ghcr.io/${{ github.repository }}
username: ${{ github.actor }}
access-token: ${{ secrets.GITHUB_TOKEN }}
force: true
chart-folder: kubernetes/helm