Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 22 additions & 65 deletions .github/workflows/chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/<owner>/charts/cattery
OCI_NAMESPACE: ${{ github.repository_owner }}/charts
HELM_VERSION: v3.16.3

jobs:
Expand All @@ -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:-<none>}"

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:-<none>} -> ${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 <<EOF >> "${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
18 changes: 18 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ trayTypes:
--agent-id <tray-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.
Expand Down
Loading