-
Notifications
You must be signed in to change notification settings - Fork 227
50 lines (46 loc) · 1.31 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
name: docs
on:
push:
branches:
- 'master'
paths:
- 'pysr/**'
- '.github/workflows/docs.yml'
- 'docs/**'
- 'setup.py'
- 'README.md'
- 'mkdocs.yml'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
- name: "Install packages for docs building"
run: pip install -r docs/requirements.txt
- name: "Install PySR"
run: pip install . && python -c 'import pysr'
- name: "Build API docs"
run: cd docs && ./gen_docs.sh
- name: "Deploy documentation to primary repository"
run: mkdocs gh-deploy --force
- name: "Deploy documentation to secondary repository"
env:
DEPLOY_KEY: ${{ secrets.DAMTP_DEPLOY_KEY }}
run: |
# Set up SSH key for authentication
mkdir -p ~/.ssh
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git checkout gh-pages
git remote add secondary [email protected]:ai-damtp-cam-ac-uk/pysr.git
git push secondary gh-pages --force