Skip to content

build: HTML/PDF/EPUB pipeline with GH Pages deploy#12

Merged
tamnd merged 5 commits into
mainfrom
build/website
Apr 19, 2026
Merged

build: HTML/PDF/EPUB pipeline with GH Pages deploy#12
tamnd merged 5 commits into
mainfrom
build/website

Conversation

@tamnd

@tamnd tamnd commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the full build pipeline so the translated guide renders as HTML, ZIP, EPUB, and PDFs and deploys to GitHub Pages at https://tamnd.github.io/bgnet-vi/.

  • bgbspd vendored as a git submodule so the upstream pandoc/xelatex toolchain is reproducible.
  • src_vi/Makefile mirrors src/Makefile with Vietnamese title and author metadata, and includes bgbspd/source.make.
  • Dockerfile.vi builds a debian:trixie-slim image with pandoc, texlive-full, Libertinus fonts (copied out of TeX Live and registered with fontconfig since fonts-libertinus is only in sid), ImageMagick 7 (native magick), librsvg, and friends.
  • scripts/build_vi.sh runs inside the container: cleans src_vi/, parallelises make all with -j, builds HTML (single + wide), split directories, 8 letter/A4 PDFs, EPUB, zips the split HTML, zips the C source examples, and stages everything into docs/ with a landing page.
  • scripts/build_vi_docker.sh wraps the above for Podman or Docker (auto-detects; override with CONTAINER_BIN=).
  • .github/workflows/deploy.yml builds the image with docker/build-push-action@v6 + GitHub Actions cache (cache-from/to: gha), runs the build inside it, uploads a Pages artifact, and deploys via actions/deploy-pages@v4. First run ~13 min (texlive-full download); subsequent runs ~1-2 min thanks to buildx cache. Pages source switched to workflow build type.
  • cs.svg labels translated (Client/Server/request/response/The Network).

docs/ is generated output and gitignored.

Verified in CI (run 24629369307)

  • docs/index.html landing page
  • docs/html/ — single, wide, split, split-wide, plus bgnet.zip / bgnet-wide.zip
  • docs/epub/bgnet.epub (135 KB)
  • docs/pdf/bgnet_{usl,a4}_{c,bw}_{1,2}.pdf — all eight variants, 500–650 KB
  • docs/source/bgnet_source.zip — C examples

Build step timing: container image 717s, guide build 46s, upload 1s.

Test plan

  • CI build succeeds
  • After merge to main, Pages deploys to https://tamnd.github.io/bgnet-vi/
  • Landing page / lists HTML, wide, split, EPUB, and all 8 PDFs
  • HTML renders with Libertinus Serif; Vietnamese diacritics display correctly
  • bgnet.zip and bgnet-wide.zip contain the split chapters
  • bgnet.epub opens in a reader

tamnd added 5 commits April 19, 2026 19:22
- src_vi/Makefile wraps bgbspd source.make with Vietnamese title/author
- Dockerfile.vi installs pandoc + texlive-xetex + Libertinus fonts
- scripts/build_vi.sh produces HTML (single/wide/split), zips, EPUB, 8 PDFs, source zip into docs/
- scripts/build_vi_docker.sh wraps the above for Podman or Docker
- .github/workflows/deploy.yml builds and deploys to GitHub Pages via Actions
- bgbspd vendored as submodule for reproducible builds
- cs.svg labels translated (Client/Server/request/response/Network)
- Dockerfile.vi: debian:trixie-slim (current stable), ImageMagick 7 native
  so drop the `magick -> convert` shim; keep the Libertinus TeX Live font
  workaround since fonts-libertinus is only in sid.
- build-image.yml: new workflow that builds Dockerfile.vi and pushes to
  ghcr.io/tamnd/bgnet-vi-build:latest on Dockerfile/bgbspd changes, with
  gha build cache. PRs build but don't push.
- deploy.yml: switch to the prebuilt GHCR image as the job container so
  each run skips the ~5 min apt-get texlive-full install and jumps
  straight to the build. Bump actions/checkout and upload-pages-artifact.
- build_vi.sh: parallelise `make all` with -j (honours BGBS_THREADS env).
@tamnd tamnd merged commit 562e5e5 into main Apr 19, 2026
2 checks passed
@tamnd tamnd deleted the build/website branch April 19, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant