Skip to content

Commit 3a2ecae

Browse files
committed
adjust github actions
1 parent 17898f1 commit 3a2ecae

File tree

2 files changed

+70
-28
lines changed

2 files changed

+70
-28
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ jobs:
1515
python-version: 3.8
1616
environment-file: environment.yml
1717
activate-environment: quantecon
18+
- name: Install latex dependencies
19+
run: |
20+
sudo apt-get -qq update
21+
sudo apt-get install -y \
22+
texlive-latex-recommended \
23+
texlive-latex-extra \
24+
texlive-fonts-recommended \
25+
texlive-fonts-extra \
26+
texlive-xetex \
27+
latexmk \
28+
xindy
1829
- name: Display Conda Environment Versions
1930
shell: bash -l {0}
2031
run: conda list
@@ -28,6 +39,20 @@ jobs:
2839
# branch: main
2940
# name: build-cache
3041
# path: _build
42+
# Build Assets (Download Notebooks and PDF via LaTeX)
43+
- name: Build PDF from LaTeX
44+
shell: bash -l {0}
45+
run: |
46+
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
47+
mkdir -p _build/html/_pdf
48+
cp -u _build/latex/*.pdf _build/html/_pdf
49+
- name: Build Download Notebooks (sphinx-tojupyter)
50+
shell: bash -l {0}
51+
run: |
52+
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
53+
mkdir -p _build/html/_notebooks
54+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
55+
# Build HTML (Website)
3156
- name: Build HTML
3257
shell: bash -l {0}
3358
run: |

.github/workflows/publish.yml

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,56 +19,73 @@ jobs:
1919
python-version: 3.8
2020
environment-file: environment.yml
2121
activate-environment: quantecon
22+
- name: Install latex dependencies
23+
run: |
24+
sudo apt-get -qq update
25+
sudo apt-get install -y \
26+
texlive-latex-recommended \
27+
texlive-latex-extra \
28+
texlive-fonts-recommended \
29+
texlive-fonts-extra \
30+
texlive-xetex \
31+
latexmk \
32+
xindy
2233
- name: Display Conda Environment Versions
2334
shell: bash -l {0}
2435
run: conda list
2536
- name: Display Pip Versions
2637
shell: bash -l {0}
2738
run: pip list
28-
- name: Build HTML
39+
# Build Assets (Download Notebooks and PDF via LaTeX)
40+
- name: Build PDF from LaTeX
2941
shell: bash -l {0}
3042
run: |
31-
jb build lectures --path-output ./
43+
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
44+
- name: Copy LaTeX PDF for GH-PAGES
45+
shell: bash -l {0}
46+
run: |
47+
mkdir -p _build/html/_pdf
48+
cp -u _build/latex/*.pdf _build/html/_pdf
3249
- name: Build Download Notebooks (sphinx-tojupyter)
3350
shell: bash -l {0}
3451
run: |
3552
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
36-
zip -r download-notebooks.zip _build/jupyter
37-
- uses: actions/upload-artifact@v2
38-
with:
39-
name: download-notebooks
40-
path: download-notebooks.zip
4153
- name: Copy Download Notebooks for GH-PAGES
4254
shell: bash -l {0}
4355
run: |
44-
mkdir _build/html/_notebooks
45-
cp _build/jupyter/*.ipynb _build/html/_notebooks
56+
mkdir -p _build/html/_notebooks
57+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
58+
# Build HTML (Website)
59+
- name: Build HTML
60+
shell: bash -l {0}
61+
run: |
62+
jb build lectures --path-output ./
4663
- name: Deploy website to gh-pages
4764
uses: peaceiris/actions-gh-pages@v3
4865
with:
4966
github_token: ${{ secrets.GITHUB_TOKEN }}
5067
publish_dir: _build/html/
51-
cname: python-advanced.quantecon.org
68+
# cname: python-advanced.quantecon.org
5269
- name: Upload "_build" folder (cache)
5370
uses: actions/upload-artifact@v2
5471
with:
5572
name: build-cache
5673
path: _build
57-
- name: Prepare lecture-python-advanced.notebooks sync
58-
shell: bash -l {0}
59-
run: |
60-
mkdir -p _build/lecture-python-advanced.notebooks
61-
cp -a _notebook_repo/. _build/lecture-python-advanced.notebooks
62-
cp _build/jupyter/*.ipynb _build/lecture-python-advanced.notebooks
63-
ls -a _build/lecture-python-advanced.notebooks
64-
- name: Commit latest notebooks to lecture-python-advanced.notebooks
65-
uses: cpina/github-action-push-to-another-repository@master
66-
env:
67-
API_TOKEN_GITHUB: ${{ secrets.QUANTECON_SERVICES_PAT }}
68-
with:
69-
source-directory: '_build/lecture-python-advanced.notebooks/'
70-
destination-repository-username: 'QuantEcon'
71-
destination-repository-name: 'lecture-python-advanced.notebooks'
72-
commit-message: 'auto publishing updates to notebooks'
73-
destination-github-username: 'quantecon-services'
74-
user-email: services@quantecon.org
74+
# - name: Prepare lecture-python-advanced.notebooks sync
75+
# shell: bash -l {0}
76+
# run: |
77+
# mkdir -p _build/lecture-python-advanced.notebooks
78+
# cp -a _notebook_repo/. _build/lecture-python-advanced.notebooks
79+
# cp _build/jupyter/*.ipynb _build/lecture-python-advanced.notebooks
80+
# ls -a _build/lecture-python-advanced.notebooks
81+
# - name: Commit latest notebooks to lecture-python-advanced.notebooks
82+
# uses: cpina/github-action-push-to-another-repository@master
83+
# env:
84+
# API_TOKEN_GITHUB: ${{ secrets.QUANTECON_SERVICES_PAT }}
85+
# with:
86+
# source-directory: '_build/lecture-python-advanced.notebooks/'
87+
# destination-repository-username: 'QuantEcon'
88+
# destination-repository-name: 'lecture-python-advanced.notebooks'
89+
# commit-message: 'auto publishing updates to notebooks'
90+
# destination-github-username: 'quantecon-services'
91+
# user-email: services@quantecon.org

0 commit comments

Comments
 (0)