forked from NeuroTechX/EEG-ExPy
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.9 KB
/
Copy pathdocs.yml
File metadata and controls
66 lines (58 loc) · 1.9 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
name: Docs
on:
push:
branches: [ master, develop, 'dev/*' ]
pull_request:
branches: [ master, develop ]
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up conda env
uses: ./.github/actions/setup-conda-env
with:
environment-file: environments/eeg-expy-docsbuild.yml
activate-environment: eeg-expy-docsbuild
- name: Get list of changed files
id: changes
run: |
git fetch origin master
git diff --name-only origin/master...HEAD > changed_files.txt
cat changed_files.txt
- name: Determine build mode
id: mode
run: |
if grep -vqE '^examples/.*\.py$' changed_files.txt; then
echo "FULL_BUILD=true" >> $GITHUB_ENV
echo "Detected non-example file change. Full build triggered."
else
# || true prevents grep's exit code 1 (no matches) from aborting the step
CHANGED_EXAMPLES=$(grep '^examples/.*\.py$' changed_files.txt | paste -sd '|' - || true)
echo "FULL_BUILD=false" >> $GITHUB_ENV
echo "CHANGED_EXAMPLES=$CHANGED_EXAMPLES" >> $GITHUB_ENV
echo "Changed examples: $CHANGED_EXAMPLES"
fi
- name: Cache built documentation
id: cache-docs
uses: actions/cache@v4
with:
path: |
doc/_build/html
key: ${{ runner.os }}-sphinx-${{ hashFiles('examples/**/*.py', 'doc/**/*', 'conf.py') }}
restore-keys: |
${{ runner.os }}-sphinx-
- name: Build docs
run: make docs
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master' # TODO: Deploy seperate develop-version of docs?
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html