Skip to content

Updated gh actions and dependencies for troubleshooting #138

Updated gh actions and dependencies for troubleshooting

Updated gh actions and dependencies for troubleshooting #138

Workflow file for this run

# Modified from: https://github.com/choldgraf/deploy_configurations/blob/master/.github/workflows/main.yml
# Note: lint with https://rhysd.github.io/actionlint/
name: Publish JupyterBook to GitHub Pages
on:
push: # trigger build only when push to master
branches:
- main
- test-gh-actions # GH actions test branch
permissions:
id-token: write
pages: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.15
- name: Install Python dependencies
run: |
sudo apt-get install python3-pip
pip install numpy
pip install sympy
pip install matplotlib
pip install jupyter-book
pip install ghp-import
PATH="${PATH}:${HOME}/.local/bin"
- name: Build book HTML
run: |
jupyter-book build ./book
- name: Push built book HTML as artifact
uses: actions/upload-pages-artifact@v3
with:
path: "book/_build/html"
- name: Deploy book HTML to Github Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Install PDF build dependencies
run: |
sudo apt-get update
# TeX tools
sudo apt-get install texlive-latex-extra \
texlive-fonts-extra \
texlive-xetex latexmk
# Image tools
sudo apt-get install libpng-dev libjpeg-dev libtiff-dev imagemagick
# SVG processing tools
sudo apt-get install inkscape
- name: Build PDF of book
run: |
jupyter-book build book --builder pdflatex
mv ./book/_build/latex/elara-handbook.pdf ./book/elara-handbook.pdf
- name: Show debug logs
run: |
cat ./book/_build/latex/elara-handbook.log # debug
- name: Upload book PDF to Github releases
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
pip install github-release-retry
github-release-retry \
--user elaraproject \
--repo elara-handbook \
--tag_name v0.0.0-$(git rev-parse HEAD | cut -c 1-8) \
--prerelease \
--body_string "Automatically generated from book sources via Github Actions" \
./book/elara-handbook.pdf