diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b2fadbe6..39c2873a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,6 +9,9 @@ on: branches: - main +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest @@ -24,26 +27,28 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -e .[docs] + - name: Configure GitHub Pages + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/configure-pages@v5 - name: Build the documentation with warnings as errors run: mkdocs build --strict + - name: Upload GitHub Pages artifact + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/upload-pages-artifact@v4 + with: + path: ./site deploy: if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest permissions: - contents: write + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/checkout@v5 - - name: Install Python - uses: actions/setup-python@v6 - with: - python-version: "3.12" - cache: pip - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[docs] - - name: Deploy to gh-pages - run: mkdocs gh-deploy --force + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5