49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Publish Helm Chart
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**/*.yaml' # Only trigger if yaml files on main are updated
|
|
|
|
jobs:
|
|
publish:
|
|
env:
|
|
REGISTRY_HOST: forge.northernlighthouseinteractive.com
|
|
runs-on: ubuntu-latest # Or whatever label your runner uses
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v3
|
|
with:
|
|
version: v3.12.0
|
|
|
|
- name: Install Dependencies
|
|
run: helm dependency update .
|
|
|
|
- name: Package Chart
|
|
run: helm package .
|
|
|
|
- name: Login to Registry
|
|
run: |
|
|
# Gitea automatically provides the token and actor variables
|
|
helm registry login ${{ env.REGISTRY_HOST }} \
|
|
--username ${{ gitea.repository_owner }} \
|
|
--password ${{ secrets.ORG_ACTIONS_TOKEN }}
|
|
|
|
- name: Push to Gitea Registry
|
|
run: |
|
|
# Clean the protocol (https://) from the URL for OCI
|
|
DOMAIN=${{ env.REGISTRY_HOST }}
|
|
DOMAIN=${DOMAIN#*//}
|
|
|
|
# Find the packaged .tgz file
|
|
CHART_FILE=$(ls *.tgz)
|
|
|
|
# Push to the OCI registry
|
|
# URL Format: oci://<domain>/<user/org>/charts
|
|
helm push $CHART_FILE oci://$DOMAIN/${{ gitea.repository_owner }}/charts |