Skip to content

Commit ad19d26

Browse files
Add build and deploy workflow
1 parent 59fc4ea commit ad19d26

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and deploy jupyter book
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
CACHE_NUMBER: 0 # increase to reset cache manually
12+
13+
jobs:
14+
build-and-deploy:
15+
runs-on:
16+
- self-hosted
17+
- doc-runner
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/cache@v3
21+
with:
22+
path: ~/miniconda3/envs/now
23+
key: conda-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }}
24+
id: cache
25+
- name: Update environment
26+
run: conda env update -n now -f environment.yml
27+
if: steps.cache.outputs.cache-hit != 'true'
28+
- name: Build jupyter book
29+
run: |
30+
source ~/miniconda3/etc/profile.d/conda.sh
31+
conda activate now
32+
pip install -r requirements.txt
33+
jupyter-book build .
34+
conda deactivate
35+
- name: Deploy jupyter book in webserver
36+
run: |
37+
ls ./
38+
scp -r _build/html/* aramislab:/srv/local/workshops/SED/2025/

0 commit comments

Comments
 (0)