36 lines
1.5 KiB
YAML
36 lines
1.5 KiB
YAML
name: Build DevOps Manual PDF
|
|
on:
|
|
push:
|
|
branches: [main, chapter3-validation]
|
|
jobs:
|
|
build-pdf:
|
|
runs-on: texlive
|
|
container:
|
|
image: ghcr.io/xu-cheng/texlive-full@sha256:c06416ebbc69c8e90e07d1f1a6f7a3f9b334e773daa3543ce879ea533317c3a7
|
|
options: --memory=1g --cpus=1
|
|
env:
|
|
BUILD_SHA: ${{ gitea.sha }}
|
|
BUILD_RUN: ${{ gitea.run_number }}
|
|
steps:
|
|
- name: Prepare recorded Actions runtime
|
|
run: apk add --no-cache nodejs=24.18.1-r0
|
|
- name: Check out triggering revision
|
|
uses: https://github.com/actions/checkout@v3.6.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Generate visible build metadata
|
|
run: |
|
|
python3 -c 'import os,pathlib; s=os.environ["BUILD_SHA"][:7]; r=os.environ["BUILD_RUN"]; assert s.isalnum() and r.isdigit(); pathlib.Path("build_meta.tex").write_text(chr(92)+"newcommand{"+chr(92)+"buildCommit}{"+s+"}"+chr(10)+chr(92)+"newcommand{"+chr(92)+"buildRun}{"+r+"}"+chr(10))'
|
|
cat build_meta.tex
|
|
- name: Compile and require nonempty PDF
|
|
run: |
|
|
latexmk -pdf -interaction=nonstopmode -halt-on-error -file-line-error devopsAssignment.tex
|
|
test -s devopsAssignment.pdf
|
|
- name: Upload versioned PDF
|
|
uses: https://github.com/actions/upload-artifact@v3.1.3
|
|
with:
|
|
name: devops-manual-build-${{ gitea.run_number }}-${{ gitea.sha }}
|
|
path: devopsAssignment.pdf
|
|
if-no-files-found: error
|
|
retention-days: 30
|