Usage Development #82
This file contains hidden or 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: mkdocs | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| merge_group: | |
| branches: [ main ] | |
| jobs: | |
| blds: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5.4.0 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| pip install jupyter-book ghp-import | |
| pip install mkdocs mkdocs-material handsdown mkdocs-jupyter | |
| - name: Generate Source Code Documentation with Handsdown | |
| run: python docs/.assets/mk_generator.py | |
| - name: Build MkDocs site and Run Jupyter Books | |
| run: mkdocs build | |
| - name: Deploy to GitHub Pages (on push or merge_group) | |
| if: github.event_name == 'push' || github.event_name == 'merge_group' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: site # Assuming mkdocs build output is the default 'site' directory | |
| - name: Preview Documentation (on PR) | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: site # Assuming mkdocs build output is the default 'site' directory |