A few days ago, I wanted to organize my resume information. Following my usual habit, I wrote it in LaTeX. However, when I wanted to publish it online to share the resume link, I needed to upload the PDF somewhere.

The PDF file of the resume is a binary file, and I didn’t want to store it directly in the repository. So I decided to use GitHub Actions to automatically compile the LaTeX file and publish the generated PDF to GitHub Pages.

After some testing, I successfully compiled the PDF file in Actions using xu-cheng/latex-action.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# https://github.com/ringsaturn/latex-to-pages-demo/blob/main/.github/workflows/build.yml
name: Compile

concurrency:
  group: "pages"
  cancel-in-progress: true

on:
  push:
    branches: main
  pull_request:
    branches: main

jobs:
  make-pdf:
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
      - uses: actions/checkout@v4
      - name: Compile LaTeX (XeLaTeX)
        uses: xu-cheng/latex-action@v4
        with:
          root_file: |
            main-en.tex
            main-zh.tex
            main-ja.tex

          texlive_version: 2025
          latexmk_use_xelatex: true  # To support CJK characters
          extra_system_packages: "fontconfig font-noto-cjk font-noto-cjk-extra"

      - name: Move PDFs to public directory
        run: |
          mv *.pdf public/

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: public/

  deploy:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    permissions:
      contents: read
      pages: write
      id-token: write
    if: github.ref == 'refs/heads/main'
    needs: make-pdf
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

The example repository is ringsaturn/latex-to-pages-demo.

Results: