Skip to content

fix(tests): start Kind cluster on demand if not having a kube config … #188

fix(tests): start Kind cluster on demand if not having a kube config …

fix(tests): start Kind cluster on demand if not having a kube config … #188

##
# Copyright (C) 2023-2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
paths:
- '**/*.mjs'
- '**/*.js'
- '**/package*.json'
- 'DEV.md'
- 'README.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: solo-linux-medium
steps:
- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with:
hugo-version: '0.124.1'
- name: Checkout Code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Setup Node with Retry
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with: |
node-version: 20.14.0
cache: npm
attempt_limit: 3
attempt_delay: 5000
- name: Setup Pages
id: pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
with:
enablement: true
- name: Install jsdoc
run: |
cd docs
npm i -g jsdoc
jsdoc --version
jsdoc -c jsdoc.conf.json
cd -
- name: Install jsdoc-to-markdown
run: |
cd docs
npm i -g jsdoc-to-markdown
jsdoc2md --version
./generate_md.sh
cd -
- name: Copy existing documentation
run: |
mkdir -p docs/content/Developer
cp DEV.md docs/content/Developer/DEV.md
mkdir -p docs/content/User
cp README.md docs/content/User/README.md
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
cd docs
echo "base_url ${{ steps.pages.outputs.base_url }}"
echo "origin ${{ steps.pages.outputs.origin }}"
echo "host ${{ steps.pages.outputs.host }}"
echo "base_path ${{ steps.pages.outputs.base_path }}"
mkdir -p themes/hugo-geekdoc
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
ls -ltr
hugo version
hugo config
hugo \
--gc \
--config hugo.toml \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: ./docs/public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: solo-linux-medium
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5