Publish Helm charts to GitHub Releases and GHCR OCI.

Add workflow_dispatch and OCI push since GitHub Pages is unavailable on this plan.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 06:24:40 +03:30
co-authored by Cursor
parent 0377cb42e5
commit 23b867c463
2 changed files with 41 additions and 5 deletions
+25
View File
@@ -8,9 +8,11 @@ on:
- charts/** - charts/**
- .cr.yaml - .cr.yaml
- .github/workflows/release-chart.yaml - .github/workflows/release-chart.yaml
workflow_dispatch:
permissions: permissions:
contents: write contents: write
packages: write
jobs: jobs:
release: release:
@@ -26,6 +28,9 @@ jobs:
git config user.name "$GITHUB_ACTOR" git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Run chart-releaser - name: Run chart-releaser
uses: helm/chart-releaser-action@v1.7.0 uses: helm/chart-releaser-action@v1.7.0
with: with:
@@ -33,3 +38,23 @@ jobs:
config: .cr.yaml config: .cr.yaml
env: env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push chart to OCI registry
run: |
shopt -s nullglob
charts=(.cr-release-packages/*.tgz)
if [ ${#charts[@]} -eq 0 ]; then
echo "No packaged charts to push"
exit 0
fi
owner=$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')
for chart in "${charts[@]}"; do
helm push "$chart" "oci://ghcr.io/${owner}/charts"
done
+16 -5
View File
@@ -58,13 +58,24 @@ Driver name: `storage.csi.kloud.team`
### From the published chart repository ### From the published chart repository
Charts are published to GitHub Pages on each release: Charts are published as [GitHub Releases](https://github.com/KubelanCloud/kks-csi-plugin/releases) and to GHCR as OCI artifacts.
**OCI (recommended):**
```bash ```bash
helm repo add kloud-csi https://kubelancloud.github.io/kks-csi-plugin helm install kloud-csi oci://ghcr.io/kubelancloud/charts/kloud-csi \
helm repo update --version 0.1.0 \
--namespace kube-system \
--create-namespace \
--set serverURL=https://csi.example.kloud.team \
--set accessToken="YOUR_CLUSTER_CSI_ACCESS_TOKEN"
```
helm install kloud-csi kloud-csi/kloud-csi \ **GitHub Release asset:**
```bash
helm install kloud-csi \
https://github.com/KubelanCloud/kks-csi-plugin/releases/download/kloud-csi-0.1.0/kloud-csi-0.1.0.tgz \
--namespace kube-system \ --namespace kube-system \
--create-namespace \ --create-namespace \
--set serverURL=https://csi.example.kloud.team \ --set serverURL=https://csi.example.kloud.team \
@@ -108,7 +119,7 @@ kubectl get storageclass kloud-csi
Chart path: [`charts/kloud-csi`](charts/kloud-csi) Chart path: [`charts/kloud-csi`](charts/kloud-csi)
Published releases are available at [GitHub Releases](https://github.com/KubelanCloud/kks-csi-plugin/releases) and via the Helm repository at `https://kubelancloud.github.io/kks-csi-plugin`. Bump `version` in [`Chart.yaml`](charts/kloud-csi/Chart.yaml) to publish a new chart release. Published releases are available at [GitHub Releases](https://github.com/KubelanCloud/kks-csi-plugin/releases) and as OCI charts at `oci://ghcr.io/kubelancloud/charts/kloud-csi`. Bump `version` in [`Chart.yaml`](charts/kloud-csi/Chart.yaml) to publish a new chart release.
### Required values ### Required values