Update link checker condition to validate pull requests from forks #226
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: Docs/Build and Publish | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| # Ensure only one concurrent deployment | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref}} | |
| cancel-in-progress: true | |
| # Restrict permissions by default | |
| permissions: | |
| contents: write # Required for committing to gh-pages | |
| pages: write # Required for deploying to Pages | |
| pull-requests: write # Required for PR comments | |
| jobs: | |
| docs-build-deploy: | |
| name: Publish Docs | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: π₯ Checkout the repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: π Install uv and set Python | |
| uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1 | |
| with: | |
| python-version: "3.10" | |
| activate-environment: true | |
| - name: ποΈ Install dependencies | |
| run: uv pip install -r pyproject.toml --group docs | |
| - name: βοΈ Configure git for github-actions | |
| run: | | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: π Deploy Development Docs | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') || github.event_name == 'workflow_dispatch' | |
| env: | |
| MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| uv run mike deploy --push develop | |
| - name: π Deploy Release Docs | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| env: | |
| MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | |
| uv run mike deploy --push --update-aliases $latest_tag latest |