chore: release v1.3.0 (#47) #17
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: Deploy MkDocs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| # Only rebuild website when docs have changed | |
| - 'README.md' | |
| - 'CHANGES.md' | |
| - 'CONTRIBUTING.md' | |
| - 'docs/**' | |
| - '.github/workflows/deploy_mkdocs.yml' | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Deploy docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[docs] | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "github-actions@users.noreply.github.com" | |
| - name: Build documentation | |
| run: | | |
| git checkout main | |
| mkdocs build | |
| - name: Deploy documentation | |
| run: | | |
| git fetch origin gh-pages:gh-pages || git checkout --orphan gh-pages | |
| git checkout gh-pages | |
| # Remove all content except .git, site and vx.x.x directory | |
| find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'v*.*.*' ! -name 'site' -exec rm -rf {} + | |
| # Copy MkDocs output | |
| cp -r site/* . | |
| # Clean up | |
| rm -rf site | |
| # Commit and push | |
| git add -A | |
| git commit -m "Deploy documentation updates" || echo "No changes to commit" | |
| git push origin gh-pages --force |