55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
|
|
name: Build DevOps IT Manual
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-manual:
|
|
name: Compile LaTeX PDF
|
|
runs-on: latex-build
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Generate build metadata
|
|
shell: sh
|
|
run: |
|
|
set -eu
|
|
SHORT_SHA="$(printf '%s' "$GITHUB_SHA" | cut -c1-7)"
|
|
BUILD_ID="v1.5+build.${GITHUB_RUN_NUMBER}.${SHORT_SHA}"
|
|
|
|
cat > manual/build_metadata.tex <<EOF
|
|
\renewcommand{\BuildIdentifier}{${BUILD_ID}}
|
|
\renewcommand{\BuildCommit}{${GITHUB_SHA}}
|
|
\renewcommand{\BuildRun}{${GITHUB_RUN_NUMBER}}
|
|
\renewcommand{\BuildAttempt}{${GITHUB_RUN_ATTEMPT:-1}}
|
|
EOF
|
|
|
|
- name: Compile complete manual
|
|
shell: sh
|
|
run: |
|
|
set -eu
|
|
cd manual
|
|
|
|
latexmk -pdf -interaction=nonstopmode \
|
|
-halt-on-error -file-line-error itManual.tex
|
|
|
|
test -s itManual.pdf
|
|
|
|
mkdir -p dist
|
|
cp itManual.pdf dist/SSW590-DevOps-IT-Manual.pdf
|
|
|
|
- name: Upload PDF artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: SSW590-DevOps-IT-Manual
|
|
path: manual/dist/SSW590-DevOps-IT-Manual.pdf
|
|
retention-days: 14
|
|
if-no-files-found: error
|
|
|