This commit is contained in:
2024-12-12 16:33:07 +01:00
parent 9625297fd7
commit 5d1a5fe932
3 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
name: Publish Helm Chart
on:
push:
branches:
- master
jobs:
build-and-publish:
name: Build and Publish Helm Chart
runs-on: ubuntu-latest
steps:
# Checkout Code
- name: Checkout Code
uses: actions/checkout@v3
# Set up Helm CLI
- name: Install Helm CLI
run: |
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# Build Helm Chart
- name: Package Helm Chart
run: |
helm package . -d ./packages/
# Login to Gitea OCI Registry
- name: Login to Gitea OCI Registry
env:
OCI_USERNAME: ${{ secrets.USER }}
OCI_PASSWORD: ${{ secrets.TOKEN }}
run: |
helm registry login -u "$OCI_USERNAME" -p "$OCI_PASSWORD" https://git.unkrig.dev
# Push Chart to OCI Registry
- name: Push Chart to OCI Registry
env:
OCI_USERNAME: ${{ secrets.USER }}
OCI_PASSWORD: ${{ secrets.TOKEN }}
run: |
helm push ./packages/*.tgz oci://git.unkrig.dev/helm-charts

11
external-service.yaml Normal file
View File

@@ -0,0 +1,11 @@
{{- if .Values.externalService.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.externalService.name }}
spec:
type: ExternalName
externalName: {{ .Values.externalService.externalName }}
ports:
- port: {{ .Values.externalService.port }}
{{- end }}

36
ingress.yaml Normal file
View File

@@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ .backend.serviceName }}
port:
number: {{ .backend.servicePort }}
{{- end }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}