Add GitHub Actions workflow for MkDocs deployment #1
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
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi | |
| pip install mkdocs mkdocs-material | |
| - name: Generate metric tables | |
| run: | | |
| if [ -f docs/gen_metric_tables.py ]; then python docs/gen_metric_tables.py; fi | |
| - name: Build MkDocs site | |
| run: mkdocs build --site-dir site | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| publish_dir: ./site | |
| publish_branch: gh-pages | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |