-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (69 loc) · 2.41 KB
/
deploy.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
77
name: deploy-book
# Only run this when the master branch changes
on:
push:
branches:
- main
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Install dependencies
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
use-mamba: true
channels: conda-forge
activate-environment: phys139
environment-file: notebooks/environment.yml
python-version: 3.10.10
auto-activate-base: false
# Check dependencies
- name: Check Miniconda
shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Build the book
shell: bash -l {0}
run: |
jupyter contrib nbextension install --user
jupyter nbextension enable --py widgetsnbextension
jupyter-book build notebooks
- name: Compile LaTeX
uses: docker://xucheng/texlive-full:latest
with:
entrypoint: /bin/sh
args: |
-c "\
cd syllabus && \
latexmk && \
cd ../homeworks/homework_1 && \
pdflatex homework_1 && \
cd ../homework_2 && \
pdflatex homework_2 && \
cd ../homework_3 && \
pdflatex homework_3 && \
cd ../homework_4 && \
pdflatex homework_4"
- name: Copy syllabus and homework for deployment
run: |
cp syllabus/syllabus.pdf notebooks/_build/html/syllabus.pdf && \
cp homeworks/homework_1/homework_1.pdf notebooks/_build/html/homework_1.pdf && \
cp homeworks/homework_2/homework_2.pdf notebooks/_build/html/homework_2.pdf && \
cp homeworks/homework_3/homework_3.pdf notebooks/_build/html/homework_3.pdf && \
cp homeworks/homework_4/homework_4.pdf notebooks/_build/html/homework_4.pdf
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: notebooks/_build/html
force_orphan: true
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"