ci: add GitHub Pages deployment for the 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
| name: Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - documentation/** | |
| - .github/workflows/docs.yml | |
| workflow_dispatch: | |
| # mike publishes the built site to the gh-pages branch. | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: docs-deploy | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| name: Build and deploy | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v6 | |
| with: | |
| # Full history so git-revision-date-localized and mike work. | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install documentation dependencies | |
| run: pip install -r documentation/requirements.txt | |
| - name: Configure git identity | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Deploy with mike | |
| working-directory: documentation | |
| run: | | |
| version=$(grep -oE "version: '[0-9]+\.[0-9]+" ../meson.build | grep -oE '[0-9]+\.[0-9]+') | |
| mike deploy --push --update-aliases "$version" latest | |
| mike set-default --push latest |