-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (77 loc) · 2.14 KB
/
Docs.yml
File metadata and controls
87 lines (77 loc) · 2.14 KB
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
name: Docs
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
unix:
runs-on: ${{ matrix.os }}
name: Build and Deploy to GitHub Pages
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
steps:
- name: "Check out"
uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
- name: "Additional info about the build"
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: "Install Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/build-docs.yml
environment-name: docs
create-args: >-
python=3.11
openmm=8.1
- name: "List conda packages"
shell: bash -l {0}
run: micromamba list
- name: "Configure"
shell: bash -l {0}
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
- name: "Build package"
shell: bash -l {0}
run: |
cd build
make -j2 install
make -j2 PythonWrapper
pip install --no-deps -e python/
- name: "Build docs"
shell: bash -l {0}
run: |
sphinx-build ./docs ./html
- name: "Deploy docs to GitHub Pages"
shell: bash -l {0}
run: |
git reset --hard HEAD
set -x
echo "::group::Push page to gh-pages branch"
git config user.name "$(git show --format=%an -s)"
git config user.email "$(git show --format=%ae -s)"
git fetch origin
git switch gh-pages
rsync -va --delete-excluded html/ docs/
touch docs/.nojekyll
git add -f docs/*
git add -f docs/.nojekyll
git commit -m "Docs from $GITHUB_REF $GITHUB_SHA" || echo "Branch is up to date"
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
echo "Deployment is deactivated in pull requests"
else
git push -f origin gh-pages
fi
echo "::endgroup::"