Skip to content

Commit 51951d1

Browse files
authored
Deploy docs to github pages (#277)
1 parent 38c67bf commit 51951d1

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
docs-deploy:
23+
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
shell: bash -l {0}
27+
28+
steps:
29+
- name: Check out code
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Miniconda
33+
uses: conda-incubator/setup-miniconda@v3
34+
with:
35+
activate-environment: torch27
36+
python-version: 3.12
37+
channels: defaults,pytorch,conda-forge
38+
39+
- name: Cache dependencies
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.conda/pkgs
44+
~/.cache/pip
45+
key: ${{ runner.os }}-docs-${{ hashFiles('.github/workflows/docs-deploy.yml') }}
46+
restore-keys: |
47+
${{ runner.os }}-docs-
48+
49+
- name: Install project with docs dependencies
50+
run: |
51+
pip install -e ".[docs]"
52+
53+
- name: Setup Pages
54+
uses: actions/configure-pages@v5
55+
56+
- name: Build documentation
57+
run: |
58+
cd docs/
59+
make html
60+
61+
- name: Upload artifact
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: ./site
65+
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)