-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (46 loc) · 1.78 KB
/
docs-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: "Deploy Docs"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# https://github.com/marketplace/actions/deploy-to-github-pages
build-docs-deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
# If you're using actions/checkout@v4 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: 3.8
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}
restore-keys: pip-
- name: Install dependencies
run: |
pip --version
pip install -U -q -r requirements.txt -r docs/requirements.txt \
-f https://download.pytorch.org/whl/cpu/torch_stable.html
pip list
- name: Make Documentation
working-directory: ./docs
run: make html --jobs 2
- name: Deploy 🚀
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'push' }}
with:
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: true # Automatically remove deleted files from the deploy branch
target-folder: docs # If you'd like to push the contents of the deployment folder into a specific directory
single-commit: true # you'd prefer to have a single commit on the deployment branch instead of full history