This commit is contained in:
43
.gitea/workflows/publish-chart.yaml
Normal file
43
.gitea/workflows/publish-chart.yaml
Normal file
@ -0,0 +1,43 @@
|
||||
name: Publish Helm Chart
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'Chart.yaml' # Only trigger if version changes or main is updated
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest # Or whatever label your runner uses
|
||||
container:
|
||||
image: alpine/helm:3.12.0 # Use an image with Helm pre-installed
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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
|
||||
echo ${{ secrets.GITEA_TOKEN }} | helm registry login ${{ gitea.server_url }} \
|
||||
--username ${{ gitea.actor }} \
|
||||
--password-stdin
|
||||
|
||||
- name: Push to Gitea Registry
|
||||
run: |
|
||||
# Clean the protocol (https://) from the URL for OCI
|
||||
DOMAIN=${{ gitea.server_url }}
|
||||
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.actor }}/charts
|
||||
Reference in New Issue
Block a user