Skip to content

0.0.14

0.0.14 #39

Workflow file for this run

name: charts - build
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
paths:
- charts/**
- .github/workflows/charts-build.yaml
push:
branches:
- helm-charts
release:
types:
- created
workflow_dispatch:
jobs:
helm:
name: Build
runs-on: ubuntu-latest
concurrency:
group: helm-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_BUILDKIT: 1
HELM_EXPERIMENTAL_OCI: 1
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
sparse-checkout: charts
- name: Create kind cluster
uses: helm/[email protected]
- name: Helm lint and package
env:
VERSION: ${{ (github.event_name == 'release' && github.event.release.tag_name) && github.event.release.tag_name || '0.0.1' }}
run: |
helm repo add external-secrets https://charts.external-secrets.io
helm install external-secrets \
external-secrets/external-secrets \
-n external-secrets \
--create-namespace \
--set installCRDs=true
charts=("$GITHUB_WORKSPACE/charts/prdeploy-api" "$GITHUB_WORKSPACE/charts/prdeploy-app" "$GITHUB_WORKSPACE/charts/prdeploy-webhooks" "$GITHUB_WORKSPACE/charts/prdeploy")
mkdir helm-charts
cd helm-charts
for chart in ${charts[@]}; do
echo "** Building chart $chart **"
name=$(basename chart)
sed -i "s/^\(app\)\?\(\s*[Vv]ersion:\s*\).\+/\1\2""$VERSION""/" "$chart/Chart.yaml"
helm dependency update $chart
helm lint $chart
helm install $name $chart --dry-run --debug
helm package $chart # Packages files to helm-charts.
done
- name: Push Helm charts
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | helm registry login registry-1.docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
charts=$(find ./helm-charts -maxdepth 1 -name "*.tgz")
for chart in $charts
do
helm push $chart oci://registry-1.docker.io/greggbjensen
done