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:
@@ -8,9 +8,11 @@ on:
|
||||
- charts/**
|
||||
- .cr.yaml
|
||||
- .github/workflows/release-chart.yaml
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
@@ -26,6 +28,9 @@ jobs:
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v4
|
||||
|
||||
- name: Run chart-releaser
|
||||
uses: helm/chart-releaser-action@v1.7.0
|
||||
with:
|
||||
@@ -33,3 +38,23 @@ jobs:
|
||||
config: .cr.yaml
|
||||
env:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user