From 6ddb2fb407989fc93307855ff3aeef1a8710cb10 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Mon, 5 Aug 2024 12:24:15 -0600 Subject: [PATCH] ci: Publishes helm chart (#78) Signed-off-by: Alfredo Gutierrez --- .github/workflows/release-push-image.yaml | 39 ++++++++++++++++------- charts/hedera-block-node/values.yaml | 2 +- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-push-image.yaml b/.github/workflows/release-push-image.yaml index a072e42bc..ef24321b8 100644 --- a/.github/workflows/release-push-image.yaml +++ b/.github/workflows/release-push-image.yaml @@ -55,16 +55,6 @@ jobs: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Get tag - run: | - if [[ "${{ github.event.inputs.version }}" ]]; then - echo "TAG=${{ github.event.inputs.version }}" >> $GITHUB_ENV - elif [[ "$GITHUB_REF_TYPE" == "tag" ]]; then - echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - else - echo "TAG=main" >> $GITHUB_ENV - fi - - name: Install JDK uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: @@ -104,8 +94,35 @@ jobs: cache-to: type=gha,mode=max platforms: linux/amd64, linux/arm64 push: true - tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG }} + tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.VERSION }} build-args: | VERSION=${{ env.VERSION }} build-contexts: | distributions=./server/build/distributions + + + helm-chart-release: + needs: publish + runs-on: [ self-hosted, Linux, medium, ephemeral ] + permissions: + contents: write + + steps: + - name: Harden Runner + uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + with: + egress-policy: audit + + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Install Helm + uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 + + - name: Publish helm chart + uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0 + with: + target_dir: charts + token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + app_version: ${{ env.VERSION }} diff --git a/charts/hedera-block-node/values.yaml b/charts/hedera-block-node/values.yaml index ad0bae35a..f81da5b5b 100644 --- a/charts/hedera-block-node/values.yaml +++ b/charts/hedera-block-node/values.yaml @@ -6,7 +6,7 @@ image: repository: ghcr.io/hashgraph/hedera-block-node pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "main" + tag: "" imagePullSecrets: [] nameOverride: ""