common-helm-lib/.gitea/workflows/buildPush.yaml
Jonas Forsberg e596c93931
All checks were successful
Lint and Test Charts / lint-test (push) Successful in 7s
Package and publish helm chart / package-helm (push) Successful in 14s
wrong step id used
2024-10-18 15:32:29 +02:00

47 lines
1.3 KiB
YAML

name: Package and publish helm chart
on:
push:
# Pattern matched against refs/tags
tags:
- '**' # Push events to every tag including hierarchical tags like v1.0/beta
jobs:
package-helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Check out code
- name: Set up Helm
uses: azure/setup-helm@v4.2.0
with:
version: v3.14.4
- name: Get package name
id: chart_name
uses: mikefarah/yq@master
with:
cmd: yq .name Chart.yaml
- name: Get package version
id: chart_version
uses: mikefarah/yq@master
with:
cmd: yq .version Chart.yaml
- name: build helm package
shell: bash
env:
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
REPO_USERNAME: ${{ secrets.REPO_USERNAME }}
REPO_HOST: ${{ secrets.REPO_HOST }}
CHART_NAME: ${{ steps.chart_name.outputs.result }}
CHART_VERSION: ${{ steps.chart_version.outputs.result }}
run: |
REPO_PATH=$(git rev-parse --show-toplevel)
mkdir /tmp/build
cd /tmp/build
helm package $REPO_PATH
helm registry login --username $REPO_USERNAME --password $REPO_PASSWORD $REPO_HOST
helm push ${CHART_NAME}-${CHART_VERSION}.tgz oci://$REPO_HOST/helm