Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update readme and hugo workflow #930

Merged
merged 20 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading