70 lines
2.1 KiB
YAML
70 lines
2.1 KiB
YAML
name: Helm Package and Push
|
|
description: Inject image tag, package helm chart and push to git.sebse.de helm registry
|
|
|
|
inputs:
|
|
chart-path:
|
|
description: Path to helm chart directory, e.g. web/charts/my-app
|
|
required: true
|
|
version:
|
|
description: Helm chart version, e.g. 0.0.0-abc1234
|
|
required: true
|
|
app-version:
|
|
description: App version / image tag, e.g. abc1234
|
|
required: true
|
|
username:
|
|
description: Registry username
|
|
required: true
|
|
password:
|
|
description: Registry password or token
|
|
required: true
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: Inject image tag into chart values
|
|
shell: bash
|
|
run: |
|
|
sed -i "s|^\(\s*tag:\).*|\1 ${{ inputs.app-version }}|" \
|
|
${{ inputs.chart-path }}/values.yaml
|
|
|
|
- name: Package helm chart (SHA)
|
|
shell: bash
|
|
run: |
|
|
helm package ${{ inputs.chart-path }} \
|
|
--version "${{ inputs.version }}" \
|
|
--app-version "${{ inputs.app-version }}"
|
|
|
|
- name: Push helm chart (SHA) to Gitea
|
|
shell: bash
|
|
run: |
|
|
CHART_NAME=$(basename ${{ inputs.chart-path }})
|
|
curl -u ${{ inputs.username }}:${{ inputs.password }} \
|
|
-X POST \
|
|
https://git.sebse.de/api/packages/sebse/helm/api/charts \
|
|
-F "chart=@${CHART_NAME}-${{ inputs.version }}.tgz" \
|
|
--fail-with-body
|
|
|
|
- name: Package helm chart (latest)
|
|
shell: bash
|
|
run: |
|
|
sed -i "s|^\(\s*tag:\).*|\1 ${{ inputs.app-version }}|" \
|
|
${{ inputs.chart-path }}/values.yaml
|
|
helm package ${{ inputs.chart-path }} \
|
|
--version "0.0.0-latest" \
|
|
--app-version "${{ inputs.app-version }}"
|
|
|
|
- name: Push helm chart (latest) to Gitea
|
|
shell: bash
|
|
run: |
|
|
CHART_NAME=$(basename ${{ inputs.chart-path }})
|
|
curl -u ${{ inputs.username }}:${{ inputs.password }} \
|
|
-X POST \
|
|
https://git.sebse.de/api/packages/sebse/helm/api/charts \
|
|
-F "chart=@${CHART_NAME}-0.0.0-latest.tgz" \
|
|
--fail-with-body
|