Build and deploy documentation site to GitHub Pages based on repo contents #807
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: Build and deploy documentation site to GitHub Pages based on repo contents | |
# This runner generated documentation using a python script | |
# For the methodology on publishing the documentation on the same github pages account as the main site, see this: https://deanattali.com/blog/multiple-github-pages-domains/ | |
on: | |
push: | |
# branches: | |
# - release | |
workflow_dispatch: | |
jobs: | |
build: | |
# Add "id-token" with the intended permissions. | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4 # checkout the repository content to github runner. | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 #install the python needed | |
- run: pip install markdown glob2 urllib3 beautifulsoup4 Pygments md_ext mkdocs_custom_fences | |
- name: execute py script # run the run.py to get the latest data | |
run: | | |
python mk_docs.py 2>&1 | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
personal_token: ${{ secrets.PAT_TOKEN }} | |
publish_dir: ./_site |