-
Notifications
You must be signed in to change notification settings - Fork 108
79 lines (77 loc) · 2.41 KB
/
build_site.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
78
79
name: Build and deploy website
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Adds keys to work with other repositories used in this lesson (e.g., UCL/github-example)
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/cache@v4 # FIXME: add apt(latex)
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '.github/python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install TeXLive
uses: DanySK/setup-texlive-action@0.1.1
- id: setup-python
name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: python -m pip install -r .github/python/requirements.txt
- name: Building notes
run: make ready
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Install bundler and dependencies
run: |
gem install bundler
bundle install
- name: Build website
run: bundle exec jekyll build
- name: Build the JupyterLite site
run: |
find . -type d -name .pytest_cache -o -name .ruff_cache -o -name .doctrees | xargs rm -rf
mkdir contents
mkdir _site/jupyter-lite
find ch*/ -type f -name '*.ipynb' ! -name '*.nbconvert.ipynb' -exec rsync -R {} contents/ \;
jupyter lite build --contents contents --output-dir _site/jupyter-lite
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
if: >
github.ref == 'refs/heads/main'
&& github.repository == 'UCL/rsd-engineeringcourse'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4