2024-10-18 12:21:00 +00:00
|
|
|
name: Lint and Test Charts
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# Pattern matched against refs/tags
|
|
|
|
tags:
|
|
|
|
- '**' # Push events to every tag including hierarchical tags like v1.0/beta
|
|
|
|
jobs:
|
2024-10-18 12:41:56 +00:00
|
|
|
package-helm:
|
2024-10-18 12:21:00 +00:00
|
|
|
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
|
|
|
|
|
2024-10-18 13:06:16 +00:00
|
|
|
- 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
|
2024-10-18 12:41:56 +00:00
|
|
|
|
2024-10-18 12:21:00 +00:00
|
|
|
- name: build helm package
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
|
|
|
|
REPO_USERNAME: ${{ vars.REPO_USERNAME }}
|
|
|
|
REPO_HOST: ${{ vars.REPO_HOST }}
|
2024-10-18 13:06:16 +00:00
|
|
|
CHART_NAME: ${{ steps.chart_username.outputs.result }}
|
|
|
|
CHART_VERSION: ${{ steps.chart_version.outputs.result }}
|
2024-10-18 12:21:00 +00:00
|
|
|
run: |
|
|
|
|
REPO_PATH=$(git rev-parse --show-toplevel)
|
2024-10-18 12:41:56 +00:00
|
|
|
CHART_NAME=$(yq .version Chart.yaml)
|
|
|
|
CHART_VERSION=$(yq .version Chart.yaml)
|
2024-10-18 12:21:00 +00:00
|
|
|
mkdir /tmp/build
|
|
|
|
cd /tmp/build
|
2024-10-18 12:28:09 +00:00
|
|
|
helm package $REPO_PATH
|
2024-10-18 12:21:00 +00:00
|
|
|
helm registry login --username $REPO_USERNAME --password $REPO_PASSWORD $REPO_HOST
|
2024-10-18 12:41:56 +00:00
|
|
|
helm push ${CHART_NAME}-${CHART_VERSION}.tgz oci://$REPO_HOST/helm
|