Skip to content

Commit

Permalink
Adding a new Job to the publish WF so it also publishes the helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Aug 1, 2024
1 parent 926b34c commit a337319
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release-push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,49 @@ jobs:
VERSION=${{ env.VERSION }}
build-contexts: |
distributions=./server/build/distributions
helm-chart-release:
runs-on: [ self-hosted, Linux, medium, ephemeral ]

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: 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: Extract version
id: extract_version
run: |
VERSION=$(grep 'version=' gradle.properties | cut -d '=' -f2)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Install Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0

- name: Use yq to update image tag
uses: mikefarah/yq-action@35f5ee3ef7d47ba98e50d8a07bc0d6d124e0517e # Reference by hash
with:
cmd: "yq eval '.image.tag = strenv(TAG)' -i charts/hedera-block-node/values.yaml"
env:
TAG: ${{ env.TAG }}

- name: Publish helm chart
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
with:
target_dir: charts
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages

0 comments on commit a337319

Please sign in to comment.