Skip to content

Commit

Permalink
feat: Publish helm chart also as an OCI package to GHCR (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Maurer <[email protected]>
Signed-off-by: Christian Hopf <[email protected]>
Co-authored-by: Christian Hopf <[email protected]>
  • Loading branch information
mkilchhofer and ckotzbauer authored Feb 28, 2024
1 parent c6b784e commit fe93b08
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main

permissions:
contents: write # for helm/chart-releaser-action to push chart release and create a release
packages: write # to push OCI chart package to GitHub Registry

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -24,3 +28,20 @@ jobs:
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true

- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push chart to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*.tgz; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}
done
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Usage

Add the repo:
Add the repo (only needed if you want to use the classical approach without using the [OCI registry](https://helm.sh/docs/topics/registries/)):

```
helm repo add kubereboot https://kubereboot.github.io/charts
Expand Down
2 changes: 1 addition & 1 deletion charts/kured/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "1.15.0"
description: A Helm chart for kured
name: kured
version: 5.4.2
version: 5.4.3
home: https://github.com/kubereboot/kured
maintainers:
- name: chopf
Expand Down
7 changes: 7 additions & 0 deletions charts/kured/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This chart installs the "Kubernetes Reboot Daemon" using the Helm Package Manage

## Prerequisites
- Kubernetes 1.9+
- Helm 3.8.0+ (to pull the chart from the OCI registry)

## Installing the Chart
To install the chart with the release name `my-release`:
Expand All @@ -13,6 +14,12 @@ $ helm repo add kubereboot https://kubereboot.github.io/charts
$ helm install my-release kubereboot/kured
```

You can also pull the helm chart from the OCI registry `ghcr.io`:

```bash
$ helm install my-release oci://ghcr.io/kubereboot/charts/kured
```

## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```bash
Expand Down

0 comments on commit fe93b08

Please sign in to comment.