From 317c2289c9c22cdbab05119ec9ba71c33091fe8e Mon Sep 17 00:00:00 2001 From: Deac Date: Fri, 29 May 2026 10:42:34 -0400 Subject: [PATCH] add chart paths for helm actions --- .gitea/actions/helm/diff/README.md | 1 + .gitea/actions/helm/diff/action.yml | 5 ++++- .gitea/actions/helm/set_deployment_image/README.md | 1 + .../actions/helm/set_deployment_image/action.yml | 5 ++++- .gitea/actions/helm/template/README.md | 1 + .gitea/actions/helm/template/action.yml | 5 ++++- .gitea/actions/helm/upgrade/README.md | 2 ++ .gitea/actions/helm/upgrade/action.yml | 14 +++++++++++--- 8 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.gitea/actions/helm/diff/README.md b/.gitea/actions/helm/diff/README.md index a488f3f..2c31e0a 100644 --- a/.gitea/actions/helm/diff/README.md +++ b/.gitea/actions/helm/diff/README.md @@ -17,6 +17,7 @@ Diff a Helm chart for a deployment in a Kubernetes cluster | `IMAGE_TAG` |

The image tag to deploy

| `true` | `""` | | `CONTAINER_NAME` |

The container component to update

| `true` | `""` | | `VALUES_FILE` |

The values file to use

| `false` | `./helm/values.yaml` | +| `CHART_PATH` |

Path to the Helm chart

| `false` | `./helm` | diff --git a/.gitea/actions/helm/diff/action.yml b/.gitea/actions/helm/diff/action.yml index 95d776a..f7925bf 100644 --- a/.gitea/actions/helm/diff/action.yml +++ b/.gitea/actions/helm/diff/action.yml @@ -19,6 +19,9 @@ inputs: VALUES_FILE: description: "The values file to use" default: "./helm/values.yaml" + CHART_PATH: + description: "Path to the Helm chart" + default: "./helm" runs: using: composite @@ -30,6 +33,6 @@ runs: - name: Helm Diff shell: sh run: | - CMD="helm diff upgrade ${{ inputs.DEPLOYMENT_NAME }} ./helm -n ${{ inputs.DEPLOYMENT_NAMESPACE }} --values ${{ inputs.VALUES_FILE }} --set deploy.${{ inputs.CONTAINER_NAME }}.tag=${{ inputs.IMAGE_TAG }} --set image.repository=${{ inputs.IMAGE_PATH }} --context 5" + CMD="helm diff upgrade ${{ inputs.DEPLOYMENT_NAME }} ${{ inputs.CHART_PATH }} -n ${{ inputs.DEPLOYMENT_NAMESPACE }} --values ${{ inputs.VALUES_FILE }} --set deploy.${{ inputs.CONTAINER_NAME }}.tag=${{ inputs.IMAGE_TAG }} --set image.repository=${{ inputs.IMAGE_PATH }} --context 5" echo "Running: $CMD" eval "$CMD" \ No newline at end of file diff --git a/.gitea/actions/helm/set_deployment_image/README.md b/.gitea/actions/helm/set_deployment_image/README.md index 068eaad..7645281 100644 --- a/.gitea/actions/helm/set_deployment_image/README.md +++ b/.gitea/actions/helm/set_deployment_image/README.md @@ -17,6 +17,7 @@ Set the image for a deployment in a Kubernetes | `IMAGE_TAG` |

The image tag to deploy

| `true` | `""` | | `CONTAINER_NAME` |

The container component to update

| `true` | `""` | | `VALUES_FILE` |

The values file to use

| `false` | `./helm/values.yaml` | +| `CHART_PATH` |

Path to the Helm chart

| `false` | `./helm` | diff --git a/.gitea/actions/helm/set_deployment_image/action.yml b/.gitea/actions/helm/set_deployment_image/action.yml index c136688..bc0692d 100644 --- a/.gitea/actions/helm/set_deployment_image/action.yml +++ b/.gitea/actions/helm/set_deployment_image/action.yml @@ -19,6 +19,9 @@ inputs: VALUES_FILE: description: "The values file to use" default: "./helm/values.yaml" + CHART_PATH: + description: "Path to the Helm chart" + default: "./helm" runs: using: composite @@ -26,6 +29,6 @@ runs: - name: Helm Set Image shell: sh run: | - CMD="helm upgrade ${{ inputs.DEPLOYMENT_NAME }} ./helm -n ${{ inputs.DEPLOYMENT_NAMESPACE }} --values ${{ inputs.VALUES_FILE }} --set deploy.${{ inputs.CONTAINER_NAME }}.tag=${{ inputs.IMAGE_TAG }} --set image.repository=${{ inputs.IMAGE_PATH }}" + CMD="helm upgrade ${{ inputs.DEPLOYMENT_NAME }} ${{ inputs.CHART_PATH }} -n ${{ inputs.DEPLOYMENT_NAMESPACE }} --values ${{ inputs.VALUES_FILE }} --set deploy.${{ inputs.CONTAINER_NAME }}.tag=${{ inputs.IMAGE_TAG }} --set image.repository=${{ inputs.IMAGE_PATH }}" echo "Running: $CMD" eval "$CMD" \ No newline at end of file diff --git a/.gitea/actions/helm/template/README.md b/.gitea/actions/helm/template/README.md index f305cd5..0cef610 100644 --- a/.gitea/actions/helm/template/README.md +++ b/.gitea/actions/helm/template/README.md @@ -17,6 +17,7 @@ Template a Helm chart for a deployment in a Kubernetes cluster | `IMAGE_TAG` |

The image tag to deploy

| `true` | `""` | | `CONTAINER_NAME` |

The container component to update

| `true` | `""` | | `VALUES_FILE` |

The values file to use

| `false` | `./helm/values.yaml` | +| `CHART_PATH` |

Path to the Helm chart

| `false` | `./helm` | diff --git a/.gitea/actions/helm/template/action.yml b/.gitea/actions/helm/template/action.yml index c84ad47..fdbef2c 100644 --- a/.gitea/actions/helm/template/action.yml +++ b/.gitea/actions/helm/template/action.yml @@ -19,6 +19,9 @@ inputs: VALUES_FILE: description: "The values file to use" default: "./helm/values.yaml" + CHART_PATH: + description: "Path to the Helm chart" + default: "./helm" runs: using: composite @@ -26,6 +29,6 @@ runs: - name: Helm Template shell: sh run: | - CMD="helm template ${{ inputs.DEPLOYMENT_NAME }} ./helm -n ${{ inputs.DEPLOYMENT_NAMESPACE }} --values ${{ inputs.VALUES_FILE }} --set deploy.${{ inputs.CONTAINER_NAME }}.tag=${{ inputs.IMAGE_TAG }} --set image.repository=${{ inputs.IMAGE_PATH }}" + CMD="helm template ${{ inputs.DEPLOYMENT_NAME }} ${{ inputs.CHART_PATH }} -n ${{ inputs.DEPLOYMENT_NAMESPACE }} --values ${{ inputs.VALUES_FILE }} --set deploy.${{ inputs.CONTAINER_NAME }}.tag=${{ inputs.IMAGE_TAG }} --set image.repository=${{ inputs.IMAGE_PATH }}" echo "Running: $CMD" eval "$CMD" \ No newline at end of file diff --git a/.gitea/actions/helm/upgrade/README.md b/.gitea/actions/helm/upgrade/README.md index 7072a11..07d45ff 100644 --- a/.gitea/actions/helm/upgrade/README.md +++ b/.gitea/actions/helm/upgrade/README.md @@ -15,6 +15,8 @@ Login to an OCI registry, update chart dependencies, and run helm upgrade for th | `REGISTRY` |

OCI registry hostname for helm dependency login

| `true` | `""` | | `REGISTRY_USERNAME` |

Username for OCI registry login

| `true` | `""` | | `REGISTRY_TOKEN` |

Token for OCI registry login

| `true` | `""` | +| `CHART_PATH` |

Path to the Helm chart

| `false` | `.` | +| `VALUES_FILE` |

Path to a values file (optional)

| `false` | `""` | diff --git a/.gitea/actions/helm/upgrade/action.yml b/.gitea/actions/helm/upgrade/action.yml index c7eb80f..251e840 100644 --- a/.gitea/actions/helm/upgrade/action.yml +++ b/.gitea/actions/helm/upgrade/action.yml @@ -13,6 +13,12 @@ inputs: 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 @@ -27,9 +33,11 @@ runs: - name: Helm Upgrade shell: sh run: | - helm dependency update - echo "Running: helm upgrade ${{ inputs.DEPLOYMENT_NAME }} ./ -n ${{ inputs.DEPLOYMENT_NAME }}" - helm upgrade ${{ inputs.DEPLOYMENT_NAME }} ./ -n ${{ inputs.DEPLOYMENT_NAME }} + 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()