-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (53 loc) · 1.71 KB
/
package-helm-chart.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
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
name: package-helm-chart
on:
push:
branches:
- main
paths:
- 'deploy/helm/**'
workflow_dispatch:
jobs:
package-helm-chart:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set environment variables
id: set-variables
run: |
echo "REPOSITORY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
echo "VERSION=$(yq -r .version ./deploy/helm/grafana-ldap-sync/Chart.yaml)" >> "$GITHUB_OUTPUT"
- name: Env variable output
id: test-variables
run: |
echo ${{ steps.set-variables.outputs.REPOSITORY }}
echo ${{ steps.set-variables.outputs.VERSION }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Package and push helm chart
run: |
helm package ./deploy/helm/grafana-ldap-sync --version ${{ steps.set-variables.outputs.VERSION }}
helm push ./grafana-ldap-sync-${{ steps.set-variables.outputs.VERSION }}.tgz oci://${{ steps.set-variables.outputs.REPOSITORY }}/charts
publish-helm-chart:
permissions:
id-token: write
packages: write
contents: write
actions: read
deployments: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}