name: Build and Deploy Docs on: push: branches: [ "main" ] paths: - "docs/**" - "mkdocs.yml" - ".github/workflows/docs.yml" jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install mkdocs and dependencies run: | python -m pip install --upgrade pip pip install -r requirements-dev.txt - name: Build docs run: | mkdocs build --clean - name: Deploy to GitHub Pages if: ${{ github.ref == 'refs/heads/main' }} uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site publish_branch: gh-pages