From f2ebf30e1070fe5581b13aa70f77060b0c4850f4 Mon Sep 17 00:00:00 2001 From: Guillermo Fidalgo Date: Tue, 23 Apr 2024 03:52:23 -0400 Subject: [PATCH] update ci and noxfile --- .github/workflows/ci.yml | 31 ++++++++----------------------- noxfile.py | 7 +++++-- pyproject.toml | 1 + 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f3bbc8..d35ec09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 id: pages - uses: actions/configure-pages@v2 - name: build output run: pipx run nox -s docs @@ -66,37 +67,21 @@ jobs: deploy: + needs: docs + runs-on: ubuntu-latest permissions: contents: write pages: write id-token: write - needs: docs - environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - # steps: - # - name: Deploy to GitHub Pages - # id: deployment - # uses: actions/deploy-pages@v4 + steps: - uses: actions/checkout@v4 - - name: Build HTML - uses: ammaraskar/sphinx-action@master - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: html-docs - path: docs/build/html/ - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' - with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build/html + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/noxfile.py b/noxfile.py index 19cb33c..f5357a7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -53,8 +53,11 @@ def docs(session: nox.Session) -> None: session.chdir("docs") session.run("sphinx-build", "-M", "html", "source/", "build") + @nox.session def serve(session: nox.Session) -> None: docs(session) - print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit") - session.run("python", "-m", "http.server", "8000", "-d", "build/html") \ No newline at end of file + print( + "Launching docs at http://localhost:8000/ - use Ctrl-C to quit" + ) # ignore ruff + session.run("python", "-m", "http.server", "8000", "-d", "build/html") diff --git a/pyproject.toml b/pyproject.toml index 07f356a..a4227cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,7 @@ lint.isort.required-imports = ["from __future__ import annotations"] [tool.ruff.lint.per-file-ignores] "tests/**" = ["T20"] +"noxfile.py" = ["T20"] [tool.mypy]