Deploy Documentation #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
| # GitHub Actions workflow to deploy MkDocs documentation to GitHub Pages | |
| # Triggered on push to master branch or manual dispatch | |
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - 'requirements-docs.txt' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ${{ vars.RUNNER }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements-docs.txt' | |
| - name: Install dependencies | |
| run: pip install -r requirements-docs.txt | |
| - name: Build documentation | |
| run: mkdocs build # add --strict when files are ready to be merged to master | |
| - name: Upload artifact | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: site/ | |
| # Deployment job (only on push to master) | |
| deploy: | |
| if: github.event_name != 'pull_request' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ${{ vars.RUNNER }} | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |