✨ Add visualization tools #98
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "00 12 * * 0" # Every Sunday noon (preserve the cache folders) | |
workflow_dispatch: | |
env: | |
PYTHON_VERSION: "3.10" | |
POETRY_VERSION: "1.3.2" | |
jobs: | |
documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Full Python version | |
run: | | |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" | |
- name: Cache Packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.local | |
.venv | |
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1.3.3 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Cache folder for Torch Uncertainty | |
uses: actions/cache@v3 | |
id: cache-folder | |
with: | |
path: | | |
~/.cache/torch-uncertainty/ | |
key: torch-uncertainty-${{ runner.os }} | |
- name: Install dependencies | |
run: | | |
poetry install --with dev --with docs | |
poetry run pip3 uninstall torch torchvision -y | |
poetry run pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Sphinx build | |
run: | | |
cd docs && poetry run make html | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: torch-uncertainty/torch-uncertainty.github.io | |
publish_branch: main | |
publish_dir: docs/build/html |