Files
ci-templates/.gitea/workflows/helm_chart_publish.yaml
2025-11-11 02:29:49 +03:00

54 lines
1.4 KiB
YAML

name: Publish helm chart
on:
workflow_call:
inputs:
ci_image:
required: true
type: string
description: image to use inside the workflow jobs
default: git.romalex.cc/public/ci-image:v1
registry_user:
required: true
type: string
description: username to access gitea registry
default: ${{ github.actor }}
secrets:
registry_access_token:
required: true
description: Token to access the gitea registry
jobs:
lint:
name: Lint Helm chart
runs-on: romalex-public
container:
image: ${{ inputs.ci_image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint
run: helm lint .
package:
name: Package and publish helm chart
runs-on: romalex-public
container:
image: ${{ inputs.ci_image }}
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cleanup
run: |
rm -rf .git
rm -rf .gitea
- name: Package
run: helm package .
- name: Publish
run: |
CHART_NAME=$(yq .name < Chart.yaml)
CHART_VERSION=$(yq .version < Chart.yaml)
curl -u ${{ inputs.registry_user }}:${{ secrets.registry_access_token }} \
-X POST \
--upload-file "${CHART_NAME}-${CHART_VERSION}.tgz" \
${{ github.server_url }}/api/packages/${{ github.repository_owner }}/helm/api/charts