2024-10-18 13:23:09 +00:00
|
|
|
name: Package and publish helm chart
|
2024-10-18 12:21:00 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
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
|
|
|
|
|
2024-11-11 10:01:57 +00:00
|
|
|
- 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-11-12 09:25:02 +00:00
|
|
|
- name: Run helm lint on all changed charts
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
helm dependency build
|
|
|
|
helm lint .
|
|
|
|
|
2024-10-18 12:21:00 +00:00
|
|
|
- name: build helm package
|
2024-11-12 09:25:02 +00:00
|
|
|
if: gitea.ref == 'refs/heads/main'
|
2024-10-18 12:21:00 +00:00
|
|
|
shell: bash
|
|
|
|
env:
|
2024-11-11 14:51:48 +00:00
|
|
|
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
2024-10-18 13:32:29 +00:00
|
|
|
CHART_NAME: ${{ steps.chart_name.outputs.result }}
|
2024-10-18 13:06:16 +00:00
|
|
|
CHART_VERSION: ${{ steps.chart_version.outputs.result }}
|
2024-10-18 12:21:00 +00:00
|
|
|
run: |
|
2024-11-12 09:25:02 +00:00
|
|
|
helm package .
|
2024-11-11 14:51:48 +00:00
|
|
|
curl -H "Authorization: token $PACKAGE_TOKEN" -X POST --upload-file ${CHART_NAME}-${CHART_VERSION}.tgz https://git.rre.nu/api/packages/jonas/helm/api/charts
|