Skip to content

Update MD picture sizing from the original docx manual #49

Update MD picture sizing from the original docx manual

Update MD picture sizing from the original docx manual #49

Workflow file for this run

name: Deploy MyST / Jupyter Book to GitHub Pages
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install MyST and dependencies
run: |
npm install
npm install -g mystmd
- name: Print MyST version
run: myst --version
# The PDF builds compile under LuaLaTeX and rely on
# \DocumentMetadata, which the LaTeX kernel only ships with
# TeX Live 2022+. Ubuntu's apt packages still ship 2023, so
# install TeX Live 2025 from upstream via zauguin's action.
#
# Package list rationale: the *recommended* collections cover
# nearly everything we need (geometry, hyperref, koma-script,
# natbib, pgf/tikz, ulem, fontspec, xcolor, lualatex-math, …);
# collection-luatex pulls in luaotfload + the LuaLaTeX engine
# itself. The standalone packages below are the ones not in
# those collections. We deliberately avoid collection-latexextra
# / collection-fontsextra (~2,700 extra packages, ~12 min, and
# one of them tripped up format-file generation in TL 2025).
- name: Install TeX Live 2025
uses: zauguin/install-texlive@v4
with:
texlive_version: 2025
# Pin a known-reliable US CTAN mirror. zauguin's default
# mirror probe has been failing intermittently with
# "No mirror available"; hardcoding RIT bypasses it.
repository: https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/
packages: >-
scheme-basic
collection-latexrecommended
collection-fontsrecommended
collection-luatex
latexmk
caption
changepage
enumitem
fontawesome5
framed
iftex
imakeidx
pdfmanagement-testphase
sourceserifpro
tagpdf
textpos
titlesec
ulem
# Run npm build to compile the custom SASS
- name: Build HTML
run: |
npm run styles:build
myst build --html --ci --max-size-webp 0
# Image shrinking is currently disabled. The 75% downscale was
# still visibly blurry on block screenshots; we accept the
# larger PDF for now in exchange for keeping image fidelity.
# Re-enable by uncommenting the step below.
#
# - name: Shrink source images for PDF
# run: |
# sudo apt-get update -qq
# sudo apt-get install -y --no-install-recommends imagemagick
# _support/scripts/shrink-images.sh images blocks/images
- name: Build PDF
run: |
myst build --pdf --ci
# myst-cli swallows latexmk's non-zero exit, so verify the
# expected PDF actually landed in output/. Without this the
# workflow only fails at upload time, far away from the
# latex error in the log.
if [ ! -s output/snap-manual.pdf ]; then
echo "::error::output/snap-manual.pdf was not produced; check the latexmk log above."
exit 1
fi
- name: Enforce CNAME file for GitHub Pages
run: echo "docs.snap.berkeley.edu" > _build/html/CNAME
- name: Stage PDFs for publishing
run: |
# PDF locations are configured in toc_pdf*.yml under exports.output.
# Copy them into the HTML output so they ship alongside the site.
mkdir -p _build/html
cp output/snap-*.pdf _build/html/ 2>/dev/null || true
# On PRs, attach all three PDFs as workflow artifacts so reviewers can
# grab a preview without running the build locally. Kept for 10 days to
# avoid filling up artifact storage.
- name: Upload PDF artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: snap-manual-pdfs
path: |
output/snap-*.pdf
retention-days: 10
# TODO: Ignore for now while secondary files are disabled.
if-no-files-found: error
# Only publish to gh-pages from main (or workflow_dispatch). PRs stop
# after building + uploading the artifact above.
- name: Publish HTML to gh-pages
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html