-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.03 KB
/
build_github_pages.yaml
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
name: GitHub Pages Build
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
jobs:
build_qutip_jupyterlite:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
python-version: "3.11"
use-mamba: true
activate-environment: qutip-jupyterlite
- name: Install jupyterlite and requirements
run: |
pip install -r requirements.txt
- name: Environment information
run: |
python -V
pip freeze
mamba info
mamba list
- name: Download qutip-tutorials
run: |
wget -O qutip-tutorials-main.zip https://github.com/qutip/qutip-tutorials/archive/main.zip
mkdir lite/files/tutorials
TUTDIR=$(pwd)/lite/files/tutorials
unzip qutip-tutorials-main.zip
cd qutip-tutorials-main/tutorials-v5
rm template.md
find . -name '*.md' -exec jupytext --to notebook {} +
find . -name '*.md' -delete
cp -r -t ${TUTDIR} .
cd -
rm -rf qutip-tutorials-main.zip qutip-tutorials-main
- name: Build QuTiP jupyterlite
run: |
./scripts/jl-build-qutip
touch _output/.nojekyll
- name: Store QuTiP jupyterlite artifact
uses: actions/upload-artifact@v4
with:
name: qutip-jupyterlite
path: |
_output
publish_to_ghpages:
needs: build_qutip_jupyterlite
runs-on: ubuntu-latest
if: ${{ github.repository == 'qutip/try-qutip' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: qutip-jupyterlite
path: publish/
- name: Publish to GitHub Pages
run: |
python -m pip install ghp-import
ghp-import -m "Automatic push by ghp-import" -f -n -p -o -r origin -b gh-pages publish