Skip to content

Commit

Permalink
[brief] Adds the new workflow to build the documentation.
Browse files Browse the repository at this point in the history
[detailed]
  • Loading branch information
marovira committed Jun 20, 2024
1 parent e015f4c commit 55d29f1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Render docs"

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
id: setup_python
with:
python-version: "3.11"

- name: Cache virtualenv
uses: actions/cache@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements/ci.txt') }}
path: venv

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements/ci.txt
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Build
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
- name: Upload
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
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ ci = [
"pytest>=8.1.1",
"types-Pillow>=10.2.0.20240311",
"types-tqdm>=4.66.0.20240106",
"build>=1.2.1"
"build>=1.2.1",
"sphinx>=7.3.7",
"furo>=2024.5.6",
"sphinx-autoapi>=3.1.1",
]

[project.urls]
Expand Down
3 changes: 3 additions & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
build>=1.2.1
furo>=2024.5.6
mypy>=1.8.0
onnx>=1.16.0
onnxruntime>=1.17.1
opencv-python>=4.9.0.80
protobuf>=3.19.6, !=4.24.0, <5.0.0
pytest>=8.1.1
ruff>=0.3.4
sphinx-autoapi>=3.1.1
sphinx>=7.3.7
tensorboard>=2.16.2
torch>=2.2.1
torchvision>=0.17.1
Expand Down

0 comments on commit 55d29f1

Please sign in to comment.