improved visual script docs #157
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: Publish Documentation | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Generate TOC | |
working-directory: . | |
run: python ./scripts/create-toc.py | |
- name: Checkout ezEngine | |
uses: actions/checkout@v2 | |
with: | |
repository: ezEngine/ezEngine | |
path: ezEngine | |
fetch-depth: 1 | |
persist-credentials: false | |
submodules: false | |
- name: Generate Code Snippetes | |
working-directory: . | |
run: python ./scripts/code-snippets.py | |
- name: Checkout docs host repo | |
uses: actions/checkout@v2 | |
with: | |
repository: ezEngine/docs | |
path: _site | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Clear docs host repo | |
run: rm -rf _site/* | |
- name: Get docfx | |
run: | | |
dotnet tool update -g docfx | |
- name: Build docs | |
run: | | |
docfx build | |
cp CNAME _site/CNAME | |
- name: Commit | |
run: | | |
export GIT_COMMITTER_NAME=$(git show -s --format='%cn') | |
export GIT_COMMITTER_EMAIL=$(git show -s --format='%ce') | |
export GIT_AUTHOR_NAME=$(git show -s --format='%an') | |
export GIT_AUTHOR_EMAIL=$(git show -s --format='%ae') | |
export COMMIT_HASH=$(git show -s --format='%H') | |
export SUBJECT=$(git show -s --format='%s') | |
cd _site | |
git add . | |
git commit -m "$SUBJECT" -m "Original commit: $COMMIT_HASH" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.API_TOKEN_GITHUB }} | |
branch: main | |
directory: _site | |
repository: ezEngine/docs | |
force: true |