name: Helm Chart CI on: push: branches: - "*" branches-ignore: - main jobs: package-and-register: name: Package and Register Helm Chart runs-on: ubuntu-latest steps: # Step 1: Checkout Repository - name: Checkout Repository uses: actions/checkout@v3 # Step 2: Check Helm Installation - name: Check Helm Installation id: helm_installed run: | if command -v helm >/dev/null 2>&1; then echo "helm_installed=true" >> $GITHUB_OUTPUT else echo "helm_installed=false" >> $GITHUB_OUTPUT fi # Step 3: Install Helm - name: Install Helm if: steps.helm_installed.outputs.helm_installed == 'false' run: | curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 chmod 700 get_helm.sh ./get_helm.sh # Step 4: Validate Helm Chart - name: Lint Helm Chart run: | helm lint ./ # Validate chart structure and syntax # Step 5: Package Helm Chart with Updated Version - name: Package Helm Chart env: COMMIT_SHA: ${{ github.sha }} run: | # Package the Helm chart helm package ./ --destination ./packages # Step 6: Push Helm Chart to Gitea - name: Push Helm Chart to Gitea env: CI_USER: ${{ secrets.CI_USER }} CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} run: | # Login to the registry echo $CI_USER_TOKEN | helm registry login centurion-version-control.default.svc.cluster.local:3000 \ --username $CI_USER --password-stdin --insecure # Push Helm chart to Gitea helm push ./packages/*.tgz oci://centurion-version-control.default.svc.cluster.local:3000/centurion/helm --plain-http