Skip to content

Commit

Permalink
update ci and noxfile
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillermoFidalgo committed Apr 23, 2024
1 parent 3d41cff commit f2ebf30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
7 changes: 5 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
print(
"Launching docs at http://localhost:8000/ - use Ctrl-C to quit"
) # ignore ruff
session.run("python", "-m", "http.server", "8000", "-d", "build/html")
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f2ebf30

Please sign in to comment.