Skip to content

Commit

Permalink
feat(ci): chart release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Thuan Vo <thvo@redhat.com>
  • Loading branch information
tthvo committed Jun 9, 2023
1 parent 4eba807 commit 946d3b3
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Helm Chart

on:
release:
types:
- "published"

defaults:
run:
shell: bash

env:
REPOSITORY: ${{ github.repository_owner }}/cryostatio.github.io
REF: main
CHART_VERSION: ${{ github.release.tag_name }}
CHART_DOWNLOAD_URL: ${{ github.release.assets[0].browser_download_url }}

jobs:
helm-release:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'cryostatio' }}
steps:
- uses: actions/checkout@v2
with:
repository: ${{ env.REPOSITORY }}
ref: ${{ env.REF }}
token: "${{ secrets.CHART_REPO_TOKEN }}"
- name: Generate chart index
run: |
DEST="${PWD}/helm-charts"
TMP_DIR="$(mktemp -d)"
cleanup() {
rm -rf "${TMP_DIR}"
}
trap EXIT cleanup
pushd ${TMP_DIR}
curl -LO $CHART_DOWNLOAD_URL && helm repo index . --url ${CHART_DOWNLOAD_URL%/*} --merge ${DEST}/index.yaml
mv index.yaml ${DEST}/index.yaml
popd
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Commit and push chart index
run: |
git add --all
git commit -m "build(helm-charts): release chart version $CHART_VERSION"
git push
27 changes: 27 additions & 0 deletions charts/cryostat/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Cryostat Helm Chart
A Helm chart for deploying [Cryostat](https://cryostat.io/) on Kubernetes and OpenShift

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

```bash
helm repo add cryostat https://cryostat.io/helm-charts
```

If you had already added this repo earlier, run `helm repo update` to retrieve
the latest versions of the packages. You can then run `helm search repo
cryostat` to see the charts.

To install the `cryostat` chart:

```bash
helm install cryostat-sample cryostat/cryostat
```

To uninstall the chart:

```bash
helm uninstall cryostat-sample
```

## Parameters

### Cryostat Container
Expand Down

0 comments on commit 946d3b3

Please sign in to comment.