Issue 8 #9
@@ -0,0 +1,59 @@
|
|||||||
|
# Builds the DevOps IT manual (manual/) into a PDF on every push to main
|
||||||
|
# that touches the manual or this workflow, and uploads it as an artifact.
|
||||||
|
name: Build IT manual
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'manual/**'
|
||||||
|
- '.gitea/workflows/manual.yml'
|
||||||
|
workflow_dispatch: # lets a team member re-run a build by hand from the Actions tab
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-manual:
|
||||||
|
# Runner label registered in Part 2. The label maps to the job image built
|
||||||
|
# from manual/ci/Dockerfile (TeX Live + Node.js), so each job runs in a
|
||||||
|
# fresh, temporary container -- never inside the Gitea container.
|
||||||
|
runs-on: latex
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out the triggering commit
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Record build identity and toolchain
|
||||||
|
run: |
|
||||||
|
SHORT_SHA="${GITHUB_SHA::7}"
|
||||||
|
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
|
||||||
|
echo "Commit: ${GITHUB_SHA} (${SHORT_SHA})"
|
||||||
|
echo "Run number: ${GITHUB_RUN_NUMBER}"
|
||||||
|
pdflatex --version | head -n 1
|
||||||
|
latexmk -v | head -n 2 | tail -n 1
|
||||||
|
python3 -c "import pygments; print('Pygments', pygments.__version__)"
|
||||||
|
|
||||||
|
- name: Compile the manual
|
||||||
|
working-directory: manual
|
||||||
|
# All options live in manual/.latexmkrc; it stops with a non-zero
|
||||||
|
# exit code on the first LaTeX error, which fails this step.
|
||||||
|
run: latexmk devopsAssignment.tex
|
||||||
|
|
||||||
|
- name: Verify the PDF exists
|
||||||
|
working-directory: manual
|
||||||
|
run: |
|
||||||
|
if [ ! -s devopsAssignment.pdf ]; then
|
||||||
|
echo "ERROR: manual/devopsAssignment.pdf is missing or empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
ls -l devopsAssignment.pdf
|
||||||
|
|
||||||
|
- name: Upload the PDF as an artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: it-manual-build-${{ github.run_number }}-${{ env.SHORT_SHA }}
|
||||||
|
path: manual/devopsAssignment.pdf
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 30
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Job image for the "latex" Gitea runner label (see .gitea/workflows/manual.yml).
|
||||||
|
#
|
||||||
|
# Base: official TeX Live image. It already includes Python + Pygments, which
|
||||||
|
# the minted package needs. A fixed release tag is used instead of "latest" so
|
||||||
|
# builds are reproducible; record the resolved digest in the manual.
|
||||||
|
FROM texlive/texlive:TL2025-historic
|
||||||
|
|
||||||
|
# The workflow's actions (checkout, upload-artifact) are JavaScript actions and
|
||||||
|
# need Node.js inside the job container; git lets checkout do a real clone.
|
||||||
|
# Packages come from the image's own Debian repositories -- no downloaded scripts.
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends nodejs git ca-certificates \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
Reference in New Issue
Block a user