-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 1.91 KB
/
helm.yml
File metadata and controls
84 lines (71 loc) · 1.91 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Helm Charts
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
REGISTRY_PATH: ghcr.io/helmcode/helm-charts
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Lint charts
run: |
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Linting $chart..."
helm lint "$chart"
fi
done
build:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Package charts
run: |
mkdir -p packages
for chart in charts/*/; do
if [ -f "$chart/Chart.yaml" ]; then
echo "Packaging $chart..."
helm package "$chart" -d packages/
fi
done
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: helm-packages
path: packages/
retention-days: 1
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
permissions:
contents: read
packages: write
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: helm-packages
path: packages/
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
- name: Push charts to GHCR
run: |
for file in packages/*.tgz; do
echo "Pushing $file..."
helm push "$file" oci://${{ env.REGISTRY_PATH }}
done