Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update helm publish registry to ghcr.io #361

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
28 changes: 20 additions & 8 deletions .github/workflows/release-push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ jobs:
helm-chart-release:
needs: publish
runs-on: block-node-linux-medium
permissions:
contents: write

steps:
- name: Harden Runner
Expand All @@ -118,10 +116,24 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0

- name: Publish helm chart
uses: step-security/helm-gh-pages@6a390e89293c1ec8bc5120f6692f3b8a313a9a3d # v1.7.0
- name: Login to GitHub Container Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
target_dir: charts
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
app_version: ${{ env.VERSION }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version
id: extract_version
run: |
VERSION=$(grep 'version=' gradle.properties | cut -d '=' -f2)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
jsync-swirlds marked this conversation as resolved.
Show resolved Hide resolved

- name: Package helm chart
run: |
helm dependency update charts/hedera-block-node
helm package charts/hedera-block-node

- name: Push helm chart
run: |
helm push block-node-helm-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hashgraph/hedera-block-node
2 changes: 1 addition & 1 deletion charts/hedera-block-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords:
maintainers:
- name: Hedera Block Node Team
email: [email protected]
name: hedera-block-node
name: block-node-helm-chart
sources:
- https://github.com/hashgraph/hedera-block-node
version: 0.3.0-SNAPSHOT
Expand Down
26 changes: 19 additions & 7 deletions charts/hedera-block-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,35 @@ minikube delete && minikube start --kubernetes-version=v1.23.0 --memory=8g --boo
```

Set environment variables that will be used for the remainder of the document:
Replacing the values with the appropriate values for your environment: bn1 is short for block-node-1, but you can name you release as you wish. And use the version that you want to install.
```bash
export RELEASE="bn1"
export RELEASE="blkNod"
export VERSION="0.3.0-SNAPSHOT"
```

## Template
To generate the K8 manifest files without installing the chart:
To generate the K8 manifest files without installing the chart, you need to clone this repo and navigate to `/charts` folder.
```bash
helm template --name-template my-bn hedera-block-node/ --dry-run --output-dir out
```

## Install
To install the chart:
## Install using a published chart

To pull the packaged chart from the public repo:
```bash
helm repo add hedera-block-node https://hashgraph.github.io/hedera-block-node/charts
helm dependency update charts/hedera-block-node
helm install "${RELEASE}" charts/hedera-block-node -f <path-to-custom-values-file>
helm pull oci://ghcr.io/hashgraph/hedera-block-node/block-node-helm-chart --version "${VERSION}"
```

To install the chart with default values:
```bash
helm install "${RELEASE}" hedera-block-node/charts/block-node-helm-chart-$VERSION.tgz
```

To install the chart with custom values:
```bash
helm install "${RELEASE}" hedera-block-node/charts/block-node-helm-chart-$VERSION.tgz -f <path-to-custom-values-file>
```

*Note:* If using the chart directly after cloning the github repo, there is no need to add the repo. and install can be directly.
Assuming you are at the root folder of the repo.
```bash
Expand Down
Loading