-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.31 KB
/
charts-build.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
name: charts - build
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
paths:
- charts/**
- .github/workflows/charts-build.yaml
push:
branches:
- helm-charts
release:
types:
- created
workflow_dispatch:
jobs:
helm:
name: Build
runs-on: ubuntu-latest
concurrency:
group: helm-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_BUILDKIT: 1
HELM_EXPERIMENTAL_OCI: 1
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
sparse-checkout: charts
- name: Create kind cluster
uses: helm/[email protected]
- name: Helm lint and package
env:
VERSION: ${{ (github.event_name == 'release' && github.event.release.tag_name) && github.event.release.tag_name || '0.0.1' }}
run: |
helm repo add external-secrets https://charts.external-secrets.io
helm install external-secrets \
external-secrets/external-secrets \
-n external-secrets \
--create-namespace \
--set installCRDs=true
charts=("$GITHUB_WORKSPACE/charts/prdeploy-api" "$GITHUB_WORKSPACE/charts/prdeploy-app" "$GITHUB_WORKSPACE/charts/prdeploy-webhooks" "$GITHUB_WORKSPACE/charts/prdeploy")
mkdir helm-charts
cd helm-charts
for chart in ${charts[@]}; do
echo "** Building chart $chart **"
name=$(basename chart)
sed -i "s/^\(app\)\?\(\s*[Vv]ersion:\s*\).\+/\1\2""$VERSION""/" "$chart/Chart.yaml"
helm dependency update $chart
helm lint $chart
helm install $name $chart --dry-run --debug
helm package $chart # Packages files to helm-charts.
done
- name: Push Helm charts
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | helm registry login registry-1.docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
charts=$(find ./helm-charts -maxdepth 1 -name "*.tgz")
for chart in $charts
do
helm push $chart oci://registry-1.docker.io/greggbjensen
done