-
Notifications
You must be signed in to change notification settings - Fork 13
54 lines (51 loc) · 1.42 KB
/
docs-preview.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
name: Build and preview docs
on:
push:
branches-ignore:
- 'main'
tags-ignore:
- v*
pull_request:
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Check for sudo
shell: bash
run: |
if type sudo >/dev/null 2>&1; then SUDO="sudo"; else SUDO=""; fi
echo "SUDO=$SUDO" >> $GITHUB_ENV
- name: Install dependencies
run: |
$SUDO bash -c "$(curl -fsSL http://neuro.debian.net/_files/neurodebian-travis.sh)"
$SUDO apt-get update -qq
$SUDO apt-get install git-annex-standalone
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e ".[docs,neurokit2]"
- name: Configure git for datalad
run: |
git config --global user.email "runner@github.com"
git config --global user.name "GITHUB CI Runner"
- name: Test build docs
run: |
BUILDDIR=_build/main make -C docs/ local
- name: Deploy preview
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1
with:
source-dir: docs/_build/main