forked from spacetelescope/jdat_notebooks
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (70 loc) · 2.35 KB
/
ci_builder.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
name: Build and deploy notebooks
# Only run this when the master branch changes
on:
push:
branches:
- main
# If your git repository has the Jupyter Book within some-subfolder next to
# unrelated files, you can make this run only if a file within that specific
# folder has been modified.
#
# paths:
# - some-subfolder/**
paths:
- 'notebooks/**.ipynb'
- '*.yml'
env:
WEBBPSF_PATH: $HOME/data/webbpsf-data
PYSYN_CDBS: $PWD/grp/redcat/trds/
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v2
- name: Set up Python 3.8.12
uses: actions/setup-python@v2 ## needed for caching
with:
python-version: 3.8.12
cache: 'pip'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install Python dependencies
run: |
sudo apt-get install python3-pip
pip install -r requirements.txt
# pip install git+git://github.com/executablebookproject/cli.git
pip install ghp-import
pip install jupyter-book
pip install myst-nb
pip install nbval
## test to bypass the jupyter-book lower version
pip install jsonschema==4.6.0
PATH="${PATH}:${HOME}/.local/bin"
#- name: nbval validation step
# run: |
# python -m pytest --nbval --durations 10
#
# #- name: Build book TOC file
# #run: |
# #jupyter-book toc from-project ./notebooks
- name: Build book HTML
run: |
jupyter-book build .
- name: Execute JDAVIZ placeholder substitution
run: |
cp jdaviz_placeholder_new.png _build/html
./placeholder.sh
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html