Skip to content

[Misc] Move to PyTorch compat (#533) #449

[Misc] Move to PyTorch compat (#533)

[Misc] Move to PyTorch compat (#533) #449

Workflow file for this run

# This workflow builds the tensordict docs and deploys them to gh-pages.
name: Generate documentation
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}
cancel-in-progress: true
jobs:
build-docs:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout tensordict
uses: actions/checkout@v3
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: build_docs
python-version: "3.9"
- name: Check Python version
run: |
python --version
- name: Install PyTorch
run: |
pip3 install pip --upgrade
pip3 install packaging
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
- name: Install TensorDict
run: |
python -m pip install -e .
- name: Test tensordict installation
run: |
mkdir _tmp
cd _tmp
python -c "import tensordict"
cd ..
- name: Build the docset
working-directory: ./docs
run: |
python -m pip install -r requirements.txt
make docs
- name: Get output time
run: echo "The time was ${{ steps.build.outputs.time }}"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/build/html # The folder the action should deploy.
CLEAN: false