-
Notifications
You must be signed in to change notification settings - Fork 14
56 lines (53 loc) · 1.7 KB
/
Copy pathdocs.yaml
File metadata and controls
56 lines (53 loc) · 1.7 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
name: Build and publish documentation
on:
push:
branches:
- master
- manuscript # remove this before merging into master
jobs:
documenation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install and set up Poetry
run: |
python get-poetry.py --preview -y
source $HOME/.poetry/env
poetry config virtualenvs.in-project true
- uses: r-lib/actions/setup-pandoc@v1
with:
pandoc-version: '2.7.3'
- name: Set up cache
uses: actions/cache@v1
with:
path: .venv
key: venv-${{ runner.os }}-documentation-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
source $HOME/.poetry/env
poetry install -E documentation
- name: Generate Documentation
working-directory: docs
run: |
source $HOME/.poetry/env
poetry run make html
- name: Commit documentation changes
run: |
git clone https://github.com/epidemics/COVIDNPIs.git --depth 1 --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}