diff --git a/.github/workflows/chart-release.yml b/.github/workflows/chart-release.yml index cae79f5..9487c38 100644 --- a/.github/workflows/chart-release.yml +++ b/.github/workflows/chart-release.yml @@ -13,15 +13,11 @@ on: - '.github/workflows/chart-release.yml' permissions: - contents: read - packages: write + contents: write # chart-releaser creates releases & pushes to gh-pages env: CHART_PATH: charts/cattery CHART_NAME: cattery - REGISTRY: ghcr.io - # Chart lands at: oci://ghcr.io//charts/cattery - OCI_NAMESPACE: ${{ github.repository_owner }}/charts HELM_VERSION: v3.16.3 jobs: @@ -44,85 +40,46 @@ jobs: - name: helm template (smoke values) run: helm template smoke "${CHART_PATH}" -f "${CHART_PATH}/ci/smoke-values.yaml" > /dev/null - check-version: - name: check for version bump + publish: + name: package & publish to GitHub Pages + # only on pushes to main; chart-releaser skips versions already released if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: lint runs-on: ubuntu-latest - outputs: - bumped: ${{ steps.v.outputs.bumped }} - version: ${{ steps.v.outputs.version }} steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 # chart-releaser needs full history to diff tags - uses: azure/setup-helm@v4 with: version: ${{ env.HELM_VERSION }} - - name: compare Chart.yaml version with previous commit - id: v + - name: configure git identity run: | - set -euo pipefail - CURRENT=$(helm show chart "${CHART_PATH}" | awk '/^version:/ {print $2}') - PREVIOUS=$(git show "HEAD^:${CHART_PATH}/Chart.yaml" 2>/dev/null | awk '/^version:/ {print $2}' || true) - - echo "current=${CURRENT}" - echo "previous=${PREVIOUS:-}" - - if [ -z "${CURRENT}" ]; then - echo "::error::Could not read version from ${CHART_PATH}/Chart.yaml" - exit 1 - fi - - if [ "${CURRENT}" = "${PREVIOUS}" ]; then - echo "Chart version unchanged (${CURRENT}); skipping publish." - echo "bumped=false" >> "${GITHUB_OUTPUT}" - else - echo "Chart version bumped: ${PREVIOUS:-} -> ${CURRENT}" - echo "bumped=true" >> "${GITHUB_OUTPUT}" - fi - echo "version=${CURRENT}" >> "${GITHUB_OUTPUT}" - - publish: - name: package & push to ghcr.io - needs: check-version - if: needs.check-version.outputs.bumped == 'true' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - uses: azure/setup-helm@v4 + - name: run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 with: - version: ${{ env.HELM_VERSION }} - - - name: helm package - run: | - mkdir -p dist - helm package "${CHART_PATH}" --destination dist/ - - - name: helm registry login - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | \ - helm registry login "${REGISTRY}" \ - --username "${{ github.actor }}" \ - --password-stdin - - - name: helm push - run: | - helm push \ - "dist/${CHART_NAME}-${{ needs.check-version.outputs.version }}.tgz" \ - "oci://${REGISTRY}/${OCI_NAMESPACE}" + charts_dir: charts + env: + CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: summary run: | cat <> "${GITHUB_STEP_SUMMARY}" - Published \`${CHART_NAME}\` chart \`${{ needs.check-version.outputs.version }}\` to: + Published charts under \`charts/\` to GitHub Pages. + + Add the repo: - oci://${REGISTRY}/${OCI_NAMESPACE}/${CHART_NAME} + helm repo add cattery https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} + helm repo update + helm install ${CHART_NAME} cattery/${CHART_NAME} - Install with: + ArgoCD source: - helm install ${CHART_NAME} oci://${REGISTRY}/${OCI_NAMESPACE}/${CHART_NAME} --version ${{ needs.check-version.outputs.version }} + repoURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} + chart: ${CHART_NAME} EOF diff --git a/README.MD b/README.MD index 1e6d967..cfb8f6c 100644 --- a/README.MD +++ b/README.MD @@ -110,6 +110,24 @@ trayTypes: --agent-id ``` +## Install with Helm + +The chart is published to a Helm repository hosted on GitHub Pages: + +```bash +helm repo add cattery https://paritytech.github.io/cattery +helm repo update +helm install cattery cattery/cattery +``` + +Override defaults with your own values: + +```bash +helm install cattery cattery/cattery -f my-values.yaml +``` + +See [charts/cattery/values.yaml](charts/cattery/values.yaml) for the available values. + ## Configuration See [docs/configuration.md](docs/configuration.md) for the full configuration reference covering server, database, GitHub App, providers, and tray types.