answer questions #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Used rhodyprog4ds repository as a template for setting up the publish file | |
name: deploy-book | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy-book: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Install dependencies | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: find file list | |
run: | | |
pip install git+https://github.com/introcompsys/courseutils@main | |
kwlcsv . | |
# Build book | |
- name: Build the book | |
run: | | |
jupyter-book build . --builder pdfhtml | |
mv _build/pdf/book.pdf _build/html/coursemanual.pdf | |
jupyter-book build . | |
# Build the syllabus only | |
- name: Build the syllaubs | |
run: | | |
cd syllabus/ | |
jupyter-book build . --toc _toc_syllabus.yml --builder pdfhtml --all | |
mv _build/pdf/book.pdf ../_build/html/syllabus.pdf | |
# Push the book's html to github-pages | |
- name: GitHub Pages action | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/html |