-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (34 loc) · 1.13 KB
/
publish-helm.yml
File metadata and controls
42 lines (34 loc) · 1.13 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
# 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: read
packages: write # Required to push to GHCR
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: 'latest'
- 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 }}/${CHART_NAME}"