-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 2.37 KB
/
helm.yml
File metadata and controls
65 lines (60 loc) · 2.37 KB
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
name: publish-chart
permissions:
packages: write
contents: read
on:
# we only publish the chart after succesful Docker build so we trigger
# a full build when chart templates are changed, this is slightly suboptimal
# TODO automatically bump chart version during build
workflow_run:
workflows: ["publish-image"]
types: [completed]
branches: ["main"]
jobs:
publish-chart:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- chart_name: crosslink-broker
chart_version: "0.1.0-main.${{ github.run_number }}"
chart_path: ./broker/chart
md_path: ./broker/descriptors/ModuleDescriptor-template.json
- chart_name: crosslink-illmock
chart_version: "0.1.0-main.${{ github.run_number }}"
chart_path: ./illmock/chart
steps:
- uses: actions/checkout@v4
- name: Calculate chart and app version with short SHA
run: |
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
CHART_VERSION="${{ matrix.chart_base_version }}+sha.$SHORT_SHA"
APP_VERSION="sha-$SHORT_SHA"
echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Process MD for okapi-hooks
if: ${{ matrix.md_path }}
run: |
sed -i "s/@version@/$CHART_VERSION/" ${{ matrix.md_path }}
sed 's/^/ /' ${{ matrix.md_path }} > indented.json
sed -i -e '/@descriptor@/{
r indented.json
d
}' ${{ matrix.chart_path }}/values.yaml
- name: helm lint
run: |
helm lint ${{ matrix.chart_path }}
- name: helm login
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u $ --password-stdin
- name: helm dependency
run: |
helm dependency build ${{ matrix.chart_path }}
- name: helm package
run: |
helm package ${{ matrix.chart_path }} --version "${{ matrix.chart_version }}+sha.$(echo $GITHUB_SHA | cut -c1-7)" --app-version "sha-$(echo $GITHUB_SHA | cut -c1-7)"
- name: helm push
run: |
helm push "${{ matrix.chart_name }}-${{ matrix.chart_version }}+sha.$(echo $GITHUB_SHA | cut -c1-7).tgz" oci://ghcr.io/${{ github.repository_owner }}/charts