Skip to content

feat: upload

feat: upload #1306

Workflow file for this run

name: Build & Relase LaTeX document
on:
push:
branches:
- master
paths:
- '.github/**'
- 'src/cheatsheet/**'
- 'src/code/**'
- 'src/doc_tex/**'
- 'src/test_tinplate/**'
- 'config.yml'
- '*.bib'
- '*.cls'
- '*.py'
- '*.tex'
pull_request:
branches:
- master
paths:
- '.github/**'
- 'src/cheatsheet/**'
- 'src/code/**'
- 'src/doc_tex/**'
- 'src/test_tinplate/**'
- 'config.yml'
- '*.bib'
- '*.cls'
- '*.py'
- '*.tex'
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || 'x' }}-${{ github.workflow }}-${{ github.ref }}-pdf
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Generate TeX files
run: |
pip install -r requirements.txt
python manager.py -l DEBUG gen-cs
python manager.py -l DEBUG gen-nb
- name: Build the LaTeX document
uses: xu-cheng/latex-action@v3
with:
latexmk_use_xelatex: true
latexmk_shell_escape: true
args: "-pdf -file-line-error -halt-on-error -interaction=nonstopmode -8bit"
extra_system_packages: |
unzip
wget
python3
py3-pip
py3-pygments
inkscape
pre_compile: |
echo "::group::Apply fonts"
cp -r fonts/* /usr/share/fonts
fc-cache -f
echo "::endgroup::"
root_file: notebook.tex
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: result
path: notebook.pdf
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: notebook.pdf
tag: ${{ github.ref }}
file_glob: true
overwrite: true