name: Publish MkDocs site on: push: branches: - main paths: - 'docs/**' - 'mkdocs.yml' - '.github/workflows/pages.yml' pull_request: paths: - 'docs/**' - 'mkdocs.yml' - '.github/workflows/pages.yml' workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: github-pages cancel-in-progress: false jobs: build: name: Build MkDocs site runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install MkDocs run: python -m pip install mkdocs-material - name: Build site run: python -m mkdocs build --strict - name: Configure Pages if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' uses: actions/configure-pages@v5 - name: Upload Pages artifact if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' uses: actions/upload-pages-artifact@v3 with: path: site deploy: name: Deploy to GitHub Pages if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy Pages artifact id: deployment uses: actions/deploy-pages@v4