forked from tskit-dev/msprime
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.92 KB
/
docs.yml
File metadata and controls
69 lines (57 loc) · 1.92 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
name: Docs
on:
pull_request:
push:
branches: [main]
tags:
- '*'
env:
BUILD_GSL: true
COMMIT_EMAIL: ben.jeffery.well+adminbot@gmail.com
MAKE_TARGET: cmodule
OWNER: tskit-dev
REPO: msprime
jobs:
build-deploy-docs:
name: Docs
runs-on: ubuntu-18.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
# As we are using pull-request-target which uses the workflow from the base
# of the PR, we need to be specific
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
id: cache
with:
path: venv
key: docs-venv-v2-${{ hashFiles('requirements/CI-docs/requirements.txt') }}
- name: Build virtualenv
if: steps.cache.outputs.cache-hit != 'true'
run: python -m venv venv
- name: Install deps
run: venv/bin/activate && pip install -r requirements/CI-docs/requirements.txt
- name: Install GSL
if: env.BUILD_GSL == 'true'
run: sudo apt-get install -y libgsl0-dev
- name: Build C module
if: env.MAKE_TARGET
run: venv/bin/activate && make $MAKE_TARGET
- name: Build Docs
run: venv/bin/activate && cd docs && make dist
- name: Trigger docs site rebuild
if: github.ref == 'refs/heads/main'
run: |
curl -X POST https://api.github.com/repos/tskit-dev/tskit-site/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u AdminBot-tskit:${{ secrets.ADMINBOT_TOKEN }} \
--data '{"event_type":"build-docs"}'