https://hackbg.github.io/toolbox #609
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: https://hackbg.github.io/toolbox | |
on: [push] | |
jobs: | |
site: | |
name: build website | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the source with its submodules | |
uses: actions/checkout@v2 | |
with: { submodules: "recursive" } | |
- name: Determine default branch | |
run: | | |
DEFAULT_BRANCH=$(git remote show origin | awk '/HEAD branch/ {print $NF}') | |
echo "default_branch=$DEFAULT_BRANCH" >> $GITHUB_ENV | |
echo "default_branch_ref=refs/heads/$DEFAULT_BRANCH" >> $GITHUB_ENV | |
- name: Setup Node and PNPM | |
uses: pnpm/[email protected] | |
with: | |
version: 8.5.1 | |
run_install: | | |
- recursive: true | |
args: [--frozen-lockfile, --strict-peer-dependencies] | |
- name: Generate TS reference | |
run: NODE_OPTIONS=--max_old_space_size=8192 pnpm docs:typedoc | |
- name: Generate VitePress guide | |
run: VITEPRESS_BASE="/toolbox/${{ github.ref_name}}/" pnpm docs:vp:build | |
- name: Collect docs | |
run: | | |
mkdir -p dist/docs | |
mv .vitepress/dist/* dist/docs | |
- name: Publish docs | |
run: | | |
pwd | |
ls -al | |
ls -al ~ | |
cat .git/config | |
git remote get-url origin | |
git fetch origin gh-pages | |
echo $(git show-ref --verify refs/remotes/origin/gh-pages | cut -c-40) > .git/refs/heads/gh-pages | |
mkdir ../page | |
mv dist/docs/* ../page | |
mv docs/ ../page/ts | |
git checkout gh-pages | |
git clean -fdx | |
touch .nojekyll | |
rm -rf "${{ github.ref_name }}" | |
mv ../page "${{ github.ref_name }}" | |
ls -al "${{ github.ref_name }}" | |
git config --global user.email "[email protected]" | |
git config --global user.name "hack.bg" | |
git add . | |
git commit -m "🤖 built docs for ${{ github.ref_name }} @ $(date -u)" || true | |
git push -u origin gh-pages --force |