|
1 |
| -name: Build Project [using jupyter-book] |
| 1 | +name: Build HTML [using jupyter-book] |
2 | 2 | on: [pull_request]
|
3 | 3 | jobs:
|
4 | 4 | preview:
|
5 |
| - runs-on: quantecon-gpu |
6 |
| - container: |
7 |
| - image: ghcr.io/quantecon/lecture-python-container:cuda-12.6.0-anaconda-2024-10-py312-b |
8 |
| - options: --gpus all |
| 5 | + runs-on: ubuntu-latest |
9 | 6 | steps:
|
10 |
| - - uses: actions/checkout@v4 |
| 7 | + - name: Checkout |
| 8 | + uses: actions/checkout@v4 |
| 9 | + - name: Setup Anaconda |
| 10 | + uses: conda-incubator/setup-miniconda@v3 |
11 | 11 | with:
|
12 |
| - ref: ${{ github.event.pull_request.head.sha }} |
13 |
| - # Check nvidia drivers |
14 |
| - - name: nvidia Drivers |
15 |
| - shell: bash -l {0} |
16 |
| - run: nvidia-smi |
| 12 | + auto-update-conda: true |
| 13 | + auto-activate-base: true |
| 14 | + miniconda-version: 'latest' |
| 15 | + python-version: "3.11" |
| 16 | + environment-file: environment.yml |
| 17 | + activate-environment: quantecon |
| 18 | + - name: Graphics Support #TODO: Review if graphviz is needed |
| 19 | + run: | |
| 20 | + sudo apt-get -qq update && sudo apt-get install -y graphviz |
| 21 | + - name: Install latex dependencies |
| 22 | + run: | |
| 23 | + sudo apt-get -qq update |
| 24 | + sudo apt-get install -y \ |
| 25 | + texlive-latex-recommended \ |
| 26 | + texlive-latex-extra \ |
| 27 | + texlive-fonts-recommended \ |
| 28 | + texlive-fonts-extra \ |
| 29 | + texlive-xetex \ |
| 30 | + latexmk \ |
| 31 | + xindy \ |
| 32 | + dvipng \ |
| 33 | + cm-super |
17 | 34 | - name: Display Conda Environment Versions
|
18 | 35 | shell: bash -l {0}
|
19 | 36 | run: conda list
|
20 | 37 | - name: Display Pip Versions
|
21 | 38 | shell: bash -l {0}
|
22 | 39 | run: pip list
|
23 | 40 | - name: Download "build" folder (cache)
|
24 |
| - uses: dawidd6/action-download-artifact@v7 |
| 41 | + uses: dawidd6/action-download-artifact@v6 |
25 | 42 | with:
|
26 | 43 | workflow: cache.yml
|
27 | 44 | branch: main
|
28 | 45 | name: build-cache
|
29 | 46 | path: _build
|
30 |
| - # Build Assets (Download Notebooks and PDF via LaTeX) |
31 |
| - - name: Build Download Notebooks (sphinx-tojupyter) |
32 |
| - shell: bash -l {0} |
33 |
| - run: | |
34 |
| - jb build lectures -n -W --keep-going --path-output ./ --builder=custom --custom-builder=jupyter |
35 |
| - mkdir -p _build/html/_notebooks |
36 |
| - cp -u _build/jupyter/*.ipynb _build/html/_notebooks |
37 |
| - - name: Upload Execution Reports (Download Notebooks) |
38 |
| - uses: actions/upload-artifact@v4 |
39 |
| - if: failure() |
40 |
| - with: |
41 |
| - name: execution-reports |
42 |
| - path: _build/jupyter/reports |
43 |
| - - name: Build PDF from LaTeX |
44 |
| - shell: bash -l {0} |
45 |
| - run: | |
46 |
| - jb build lectures --builder pdflatex --path-output ./ -W --keep-going |
47 |
| - mkdir -p _build/html/_pdf |
48 |
| - cp -u _build/latex/*.pdf _build/html/_pdf |
49 |
| - - name: Upload Execution Reports (LaTeX) |
50 |
| - uses: actions/upload-artifact@v4 |
51 |
| - if: failure() |
52 |
| - with: |
53 |
| - name: execution-reports |
54 |
| - path: _build/latex/reports |
55 |
| - # Final Build of HTML |
| 47 | + # # Build Assets (Download Notebooks and PDF via LaTeX) |
| 48 | + # - name: Build PDF from LaTeX |
| 49 | + # shell: bash -l {0} |
| 50 | + # run: | |
| 51 | + # jb build lectures --builder pdflatex --path-output ./ -n --keep-going |
| 52 | + # mkdir -p _build/html/_pdf |
| 53 | + # cp -u _build/latex/*.pdf _build/html/_pdf |
| 54 | + # - name: Upload Execution Reports (LaTeX) |
| 55 | + # uses: actions/upload-artifact@v4 |
| 56 | + # if: failure() |
| 57 | + # with: |
| 58 | + # name: execution-reports |
| 59 | + # path: _build/latex/reports |
| 60 | + # - name: Build Download Notebooks (sphinx-tojupyter) |
| 61 | + # shell: bash -l {0} |
| 62 | + # run: | |
| 63 | + # jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter |
| 64 | + # mkdir -p _build/html/_notebooks |
| 65 | + # cp -u _build/jupyter/*.ipynb _build/html/_notebooks |
| 66 | + # Build HTML (Website) |
| 67 | + # BUG: rm .doctress to remove `sphinx` rendering issues for ipywidget mimetypes |
| 68 | + # and clear the sphinx cache for building final HTML documents. |
| 69 | + # rm -r _build/.doctrees |
56 | 70 | - name: Build HTML
|
57 | 71 | shell: bash -l {0}
|
58 | 72 | run: |
|
59 |
| - jb build lectures --path-output ./ -n -W --keep-going |
| 73 | + jb build lectures --path-output ./ -nW --keep-going |
60 | 74 | - name: Upload Execution Reports (HTML)
|
61 | 75 | uses: actions/upload-artifact@v4
|
62 | 76 | if: failure()
|
63 | 77 | with:
|
64 | 78 | name: execution-reports
|
65 | 79 | path: _build/html/reports
|
66 | 80 | - name: Preview Deploy to Netlify
|
67 |
| - uses: nwtgck/actions-netlify@v3 |
| 81 | + uses: nwtgck/actions-netlify@v3.0 |
68 | 82 | with:
|
69 | 83 | publish-dir: '_build/html/'
|
70 | 84 | production-branch: main
|
|
0 commit comments