Docs/mkdocs #4
Workflow file for this run
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 | |
| permissions: | |
| contents: write | |
| pages: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - '**' # Match all branches for pull requests | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| deploy-pr: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| pip install .[docs] | |
| - name: Deploy to GitHub Pages (Pull Request) | |
| env: | |
| ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} | |
| run: | | |
| git config --global user.name '${{ github.actor }}' | |
| git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
| mike deploy --push develop | |
| deploy-main: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| pip install .[docs] | |
| - name: Deploy to GitHub Pages (Main) | |
| env: | |
| ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} | |
| run: | | |
| git config --global user.name '${{ github.actor }}' | |
| git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
| mike deploy --push main | |
| mike set-default --push main | |
| deploy-release: | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| pip install .[docs] | |
| - name: Set release notes tag | |
| run: | | |
| export RELEASE_TAG_VERSION=${{ github.event.release.tag_name }} | |
| echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION}" >> $GITHUB_ENV | |
| - name: Deploy to GitHub Pages | |
| env: | |
| ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} | |
| run: | | |
| git config --global user.name '${{ github.actor }}' | |
| git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
| mike deploy --push --update-aliases ${RELEASE_TAG_VERSION} latest | |
| mike set-default --push latest |