-
Notifications
You must be signed in to change notification settings - Fork 25
87 lines (74 loc) · 2.06 KB
/
docs_website.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
name: Documentation website
on:
workflow_dispatch:
push:
branches:
- main
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{hashFiles('environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
name: Install dependencies
with:
environment-file: doc/environment.yml
auto-activate-base: false
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
- name: Describe environment
run: |
pwd
ls
conda list
- name: Install openmm-ml
run: |
pip install .
- name: Build Sphinx documentation
run: |
cd doc
make html
- name: Checkout gh-pages
if: success()
uses: actions/checkout@v2
with:
ref: gh-pages
path: 'deploy'
clean: false
- name: Prepare development deployment
if: success() && github.event_name == 'push'
run: |
rm -rf deploy/dev
mv doc/build/html deploy/dev
- name: Prepare release deployment
if: success() && github.event_name == 'release'
run: |
rm -rf deploy/${{ github.ref_name }}
mkdir -p deploy/${{ github.ref_name }}
mv -T doc/build/html deploy/${{ github.ref_name }}
rm -rf deploy/latest
ln -s ${{ github.ref_name }} deploy/latest
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: deploy
jekyll: false
commit_message: "Deploy to GH Pages"
keep_history: true
follow_symlinks: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}