-
Notifications
You must be signed in to change notification settings - Fork 9
82 lines (73 loc) · 2.77 KB
/
build-and-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
# Publish the static Sphinx build on Trading Strategy server using rsync
name: Docs build
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch git submodules
run: make update-git-submodules
- name: Install poetry
run: pipx install poetry==1.6.1
- name: Set up Python 3.10
uses: actions/setup-python@v4
# If caches were enabled, it was caching Python 3.8 interpreter
# causing the docs build to fails
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y pandoc
poetry env use '3.10'
poetry install -vv
# TODO: Hack fix if this is the cause for problems in doc builds
- name: Build documentation
run: |
poetry env use '3.10'
python -V
which python
echo $PATH
VENV_BIN=`poetry env info -p`/bin
PYTHON=`poetry env info -p`/bin/python
PIP=`poetry env info -p`/bin/pip
SPHINX=`poetry env info -p`/bin/sphinx-build
PATH=$VENV_BIN:$PATH
make pip-force-install-deps
make install-furo
make rebuild-furo
make clean-autosummary
make html
# https://zellwk.com/blog/github-actions-deploy/
# https://github.com/webfactory/ssh-agent
- name: Install SSH Key
uses: webfactory/[email protected]
with:
# PK key pair generated locally and
# public SSH key copied to the server
ssh-private-key: ${{ secrets.RSYNC_KEY }}
- name: Publish docs via rsync
run: |
echo "Running $RSYNC_COMMAND"
$RSYNC_COMMAND
env:
# RSYNC_COMMAND="scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r docs/build/html docs@poly:."
RSYNC_COMMAND: ${{ secrets.RSYNC_COMMAND }}
- name: Run Docsearch Scraper
uses: celsiusnarhwal/typesense-scraper@v2
with:
# The secret containing your Typesense API key. Required.
api-key: ${{ secrets.TYPESENSE_API_KEY }}
# The hostname or IP address of your Typesense server. Required.
host: ${{ secrets.TYPESENSE_HOST }}
# The port on which your Typesense server is listening. Optional. Default: 8108.
port: 443
# The protocol to use when connecting to your Typesense server. Optional. Default: http.
protocol: https
# The path to your DocSearch config file. Optional. Default: docsearch.config.json.
config: ./scraper/config.json