diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index ece8ef8e..abef1cfc 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -103,8 +103,6 @@ jobs: helm-chart-release: needs: publish runs-on: block-node-linux-medium - permissions: - contents: write steps: - name: Harden Runner @@ -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 + + - 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 diff --git a/charts/hedera-block-node/Chart.yaml b/charts/hedera-block-node/Chart.yaml index ef587e67..a599ba38 100644 --- a/charts/hedera-block-node/Chart.yaml +++ b/charts/hedera-block-node/Chart.yaml @@ -10,7 +10,7 @@ keywords: maintainers: - name: Hedera Block Node Team email: blocknode@hashgraph.com -name: hedera-block-node +name: block-node-helm-chart sources: - https://github.com/hashgraph/hedera-block-node version: 0.3.0-SNAPSHOT diff --git a/charts/hedera-block-node/README.md b/charts/hedera-block-node/README.md index 5caa5114..2af13e16 100644 --- a/charts/hedera-block-node/README.md +++ b/charts/hedera-block-node/README.md @@ -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 +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 +``` + *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