Add Gitea Actions workflow and LaTeX job image for the IT manual (#6)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user