-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.36 KB
/
publish-helm.yml
File metadata and controls
48 lines (39 loc) · 1.36 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
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
# SPDX-License-Identifier: Apache-2.0
name: Publish Helm Chart GHCR
"on":
push:
branches:
- main
paths:
- 'charts/**'
workflow_dispatch: {}
jobs:
publish-chart:
runs-on: ubuntu-latest
permissions:
contents: write # Required for pushing the repository
packages: write # Required to push to GHCR
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install Helm
uses: azure/setup-helm@v4.3.1
- name: Bump Helm Chart
uses: pluralsh/chart-releaser@v0.1.3
with:
path: ./charts/openstack-hypervisor-operator/
release: "0.1.0"
branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Package Helm chart
run: |
helm package ./charts/openstack-hypervisor-operator
- name: Log in to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
- name: Push Helm chart to GHCR
run: |
CHART_NAME=openstack-hypervisor-operator
CHART_VERSION=$(grep "version:" ./charts/${CHART_NAME}/Chart.yaml | awk '{print $2}')
helm push "${CHART_NAME}-${CHART_VERSION}.tgz" "oci://ghcr.io/${{ github.repository_owner }}/charts"