Skip to content

Instantly share code, notes, and snippets.

@megrxu
Last active March 6, 2024 14:16
Show Gist options
  • Save megrxu/2a14ca391a093b74a381d876abfbb95b to your computer and use it in GitHub Desktop.
Save megrxu/2a14ca391a093b74a381d876abfbb95b to your computer and use it in GitHub Desktop.
A GitHub Actions workflow configuration to build TeX files with extra fonts.
name: Build
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v1
- name: Install TeX Live packages # (Note that you may don't need some of them)
run: sudo apt install -y texlive-base texlive-xetex texlive-lang-chinese latexmk
- name: Download the fonts
run: for i in simhei.ttf simkai.ttf simsun.ttc simsunb.ttf simfang.ttf; do wget -P fonts/ https://xugr.keybase.pub/static/fonts/$i; done
- name: Copy the fonts # In newer version of fontconfig, it reads $HOME/.local/share/fonts/ but not $HOME/.fonts
run: mkdir -p ~/.local/share/fonts && cp -r fonts/* ~/.local/share/fonts/
- name: Build font information caches
run: fc-cache -rv
- name: Compile LaTeX document
run: latexmk -xelatex -interaction=nonstopmode -file-line-error report.tex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment