-
Notifications
You must be signed in to change notification settings - Fork 78
117 lines (103 loc) · 3.79 KB
/
docs.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Build docs
on:
push:
branches:
- main
pull_request:
branches:
- main
- public
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache dependencies
id: pip-cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout cebra figures
uses: actions/checkout@v3
with:
repository: AdaptiveMotorControlLab/cebra-figures
path: docs/source/cebra-figures
ref: main
- name: Checkout assets
uses: actions/checkout@v3
with:
repository: AdaptiveMotorControlLab/cebra-assets
path: assets
ref: main
- name: Add assets to repo
run: |
cp -r assets/* .
rm -r assets
- name: Checkout cebra demos
uses: actions/checkout@v3
with:
repository: AdaptiveMotorControlLab/cebra-demos
path: docs/source/demo_notebooks
ref: main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip setuptools wheel
# NOTE(stes) Pandoc version must be at least (2.14.2) but less than (4.0.0).
# as of 29/10/23. Ubuntu 22.04 which is used for ubuntu-latest only has an
# old pandoc version (2.9.). We will hence install the latest version manually.
# previou: sudo apt-get install -y pandoc
wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb
sudo dpkg -i pandoc-3.1.9-1-amd64.deb
rm pandoc-3.1.9-1-amd64.deb
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install '.[docs]'
- name: Build docs
run: |
ls docs/source/cebra-figures
# later also add the -n option to check for broken links
export SPHINXOPTS="-W --keep-going -n"
make docs
# NOTE(stes): To avoid issues as observed in
# https://github.com/AdaptiveMotorControlLab/CEBRA/pull/20, we modified
# this workflow to not rely on PATs. All repos except for the website
# repo are public and only read access is required, so we simply removed
# the tokens from the checkout actions.
#
# For pushing the docs, I temporarily disabled the staging repo, which
# does not add anything informative to the contributor anyways, as it just
# tests whether or not docs can be pushed (the staging branch is not deployed).
#
# The production branch will be built after the PR is merged to main.
#
# Commented code for staging branch:
#- name: Deploy docs (staging)
# uses: cpina/github-action-push-to-another-repository@main
# if: github.ref != 'refs/heads/main'
# env:
# API_TOKEN_GITHUB: ${{ secrets.GH_PAT_WEBSITE }}
# with:
# source-directory: 'docs/page'
# destination-github-username: 'stes'
# destination-repository-name: 'cebra-ai'
# user-name: stes
# user-email: [email protected]
# target-branch: staging
- name: Deploy docs (production)
uses: cpina/github-action-push-to-another-repository@main
if: github.ref == 'refs/heads/main'
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT_WEBSITE }}
with:
source-directory: 'docs/page'
destination-github-username: 'stes'
destination-repository-name: 'cebra-ai'
user-name: stes
user-email: [email protected]
target-branch: main