Files
gitea-actions/.gitea/actions/helm/upgrade/action.yml
T
2026-05-29 10:42:34 -04:00

46 lines
1.5 KiB
YAML

name: Helm Upgrade
description: Login to an OCI registry, update chart dependencies, and run helm upgrade for the chart in the current directory
inputs:
DEPLOYMENT_NAME:
description: "The Helm release name and target namespace"
required: true
REGISTRY:
description: "OCI registry hostname for helm dependency login"
required: true
REGISTRY_USERNAME:
description: "Username for OCI registry login"
required: true
REGISTRY_TOKEN:
description: "Token for OCI registry login"
required: true
CHART_PATH:
description: "Path to the Helm chart"
default: "."
VALUES_FILE:
description: "Path to a values file (optional)"
default: ""
runs:
using: composite
steps:
- name: Helm OCI Login
shell: sh
run: |
echo "${{ inputs.REGISTRY_TOKEN }}" | helm registry login ${{ inputs.REGISTRY }} \
--username ${{ inputs.REGISTRY_USERNAME }} \
--password-stdin
- name: Helm Upgrade
shell: sh
run: |
helm dependency update ${{ inputs.CHART_PATH }}
VALUES_FLAG=""
if [ -n "${{ inputs.VALUES_FILE }}" ]; then VALUES_FLAG="--values ${{ inputs.VALUES_FILE }}"; fi
echo "Running: helm upgrade ${{ inputs.DEPLOYMENT_NAME }} ${{ inputs.CHART_PATH }} -n ${{ inputs.DEPLOYMENT_NAME }} $VALUES_FLAG"
helm upgrade ${{ inputs.DEPLOYMENT_NAME }} ${{ inputs.CHART_PATH }} -n ${{ inputs.DEPLOYMENT_NAME }} $VALUES_FLAG
- name: Remove kubeconfig
if: always()
shell: sh
run: rm -f ~/.kube/config