Skip to content

Commit

Permalink
feat: update readme and hugo workflow (#930)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
Signed-off-by: Swirlds Automation <[email protected]>
Signed-off-by: Jeromy Cannon <[email protected]>
Co-authored-by: Swirlds Automation <[email protected]>
Co-authored-by: Jeromy Cannon <[email protected]>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent f546a79 commit 0e08abc
Show file tree
Hide file tree
Showing 27 changed files with 1,478 additions and 1,160 deletions.
1 change: 1 addition & 0 deletions .github/workflows/flow-hugo-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- '**/*.js'
- '**/*.ts'
- '**/package*.json'
- 'docs/content/User/*.md'
- 'DEV.md'
- 'README.md'
# run in the pull request, but don't publish
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/script/update_md.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash

# This script is used to run some common solo commands, and use the output to update
# the docs/content/User/StepByStepGuide.md file. This is useful to keep the guide up to date

set -xeo pipefail
export SOLO_CLUSTER_NAME=solo
export SOLO_NAMESPACE=solo
Expand Down Expand Up @@ -38,12 +42,12 @@ echo "Generate README.md"
envsubst '$KIND_CREATE_CLUSTER_OUTPUT,$SOLO_INIT_OUTPUT,$SOLO_NODE_KEY_PEM_OUTPUT,$SOLO_CLUSTER_SETUP_OUTPUT, \
$SOLO_NETWORK_DEPLOY_OUTPUT,$SOLO_NODE_SETUP_OUTPUT,$SOLO_NODE_START_OUTPUT,$SOLO_MIRROR_NODE_DEPLOY_OUTPUT,\
$SOLO_RELAY_DEPLOY_OUTPUT'\
< README.md.template > README.md
< docs/content/User/StepByStepGuide.md.template > docs/content/User/StepByStepGuide.md

echo "Remove color codes and lines showing intermediate progress"

sed -i 's/\[32m//g' README.md
sed -i 's/\[33m//g' README.md
sed -i 's/\[39m//g' README.md
egrep -v '↓|❯|•' README.md > README.md.tmp && mv README.md.tmp README.md
sed -i 's/\[32m//g' docs/content/User/StepByStepGuide.md
sed -i 's/\[33m//g' docs/content/User/StepByStepGuide.md
sed -i 's/\[39m//g' docs/content/User/StepByStepGuide.md
egrep -v '↓|❯|•' docs/content/User/StepByStepGuide.md > docs/content/User/StepByStepGuide.md.tmp && mv docs/content/User/StepByStepGuide.md.tmp docs/content/User/StepByStepGuide.md
set +x
13 changes: 8 additions & 5 deletions .github/workflows/zxc-update-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
##

name: Update README.md

# This workflow calls script update_md.sh to update the docs/content/User/StepByStepGuide.md file
on:
workflow_dispatch:
workflow_call:
secrets:
GH_ACCESS_TOKEN:
Expand Down Expand Up @@ -92,7 +95,7 @@ jobs:
sudo apt-get update
sudo apt-get install gettext-base
- name: Update README.md
- name: Update docs/content/User/StepByStepGuide.md
run: |
set -xeo pipefail
npm install
Expand All @@ -107,7 +110,7 @@ jobs:
./.github/workflows/script/update_md.sh </dev/null | cat
set +x
- name: Check README.md Changes
- name: Check docs/content/User/StepByStepGuide.md Changes
id: check-readme-changes
run: |
CHANGES=$(git diff --stat)
Expand Down Expand Up @@ -138,15 +141,15 @@ jobs:
git_user_signingkey: true
git_commit_gpgsign: true

- name: Commit README.md Changes
- name: Commit docs/content/User/StepByStepGuide.md Changes
id: commit-readme
if : ${{ github.event.inputs.dry-run-enabled != 'true' && !cancelled() && !failure() && inputs.commit-changes }}
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_message: "auto update README.md [skip ci]"
commit_message: "auto update docs/content/User/StepByStepGuide.md [skip ci]"
commit_options: '--no-verify --signoff'
add_options: '-u'
file_pattern: 'README.md'
file_pattern: 'docs/content/User/StepByStepGuide.md'
commit_user_name: Swirlds Automation
commit_user_email: [email protected]
commit_author: Swirlds Automation <[email protected]>
Expand Down
Loading

0 comments on commit 0e08abc

Please sign in to comment.