forked from networkx/networkx
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.96 KB
/
deploy-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
name: deploy
on:
push:
branches: [ master ]
jobs:
documentation:
# Do not attempt to deploy documentation on forks
if: github.repository_owner == 'networkx'
runs-on: Ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Before install
run: |
sudo apt-get update
sudo apt-get install libgdal-dev graphviz graphviz-dev
sudo apt-get install texlive texlive-latex-extra latexmk texlive-xetex
sudo apt-get install fonts-freefont-otf xindy
sudo apt-get install libgeos-dev libproj-dev
sudo apt-get install libspatialindex-dev
- name: Mayavi setup
run: |
sudo apt-get --no-install-recommends install -y libxkbcommon-x11-0 optipng libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 xcb libxcb-xfixes0 libxcb-xinerama0 libxcb-shape0
export DISPLAY=:99
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x200x24 -ac +extension GLX +render -noreset;
- name: Install packages
run: |
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt
pip install -r requirements/extra.txt
pip install -r requirements/example-requirements.txt
pip install -r requirements/example.txt
pip install -U -r requirements/doc.txt
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip install gdal==3.0.4
pip install .
pip list
# To set up a cross-repository deploy key:
# 1. Create a key pair:
# `ssh-keygen -t ed25519 -C "nx_doc_deploy_bot@nomail"`
# 2. Add the public key to the networkx/documentation repo
# - Settings -> Deploy keys -> Add new
# - Make sure the key has write permissions
# 3. Add private key as a secret to networkx/networkx repo
# - Settings -> Secrets -> New Repository Secret
# - Make sure the name is the same as below: CI_DEPLOY_KEY
- name: Install SSH agent
if: github.ref == 'refs/heads/master'
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.CI_DEPLOY_KEY }}
- name: Build docs
if: github.ref == 'refs/heads/master'
run: |
export DISPLAY=:99
make -C doc/ html
make -C doc/ latexpdf LATEXOPTS="-file-line-error -halt-on-error"
cp -a doc/build/latex/networkx_reference.pdf doc/build/html/_downloads/.
- name: Deploy docs
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GIT_CONFIG_NAME: nx-doc-deploy-bot
GIT_CONFIG_EMAIL: nx-doc-deploy-bot@nomail
FOLDER: doc/build/html
REPOSITORY_NAME: networkx/documentation
BRANCH: gh-pages
TARGET_FOLDER: latest
SSH: true