48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
# Gitea Actions workflow for the SSW 590 DevOps IT manual.
|
|
# The runner label must match the registered self-managed Gitea runner.
|
|
name: manual-pdf
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-manual:
|
|
runs-on: windows-latex-host
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Generate build metadata
|
|
shell: powershell
|
|
run: |
|
|
$shortSha = $env:GITHUB_SHA.Substring(0, 7)
|
|
$runNumber = $env:GITHUB_RUN_NUMBER
|
|
$runAttempt = $env:GITHUB_RUN_ATTEMPT
|
|
@"
|
|
\renewcommand{\BuildIdentifier}{+build.$runNumber.$shortSha}
|
|
\renewcommand{\SourceRevision}{$shortSha}
|
|
\renewcommand{\WorkflowRunNumber}{$runNumber}
|
|
\renewcommand{\WorkflowRunAttempt}{$runAttempt}
|
|
"@ | Set-Content -Path devopsBuildMetadata.tex -Encoding ASCII
|
|
|
|
- name: Compile manual
|
|
shell: powershell
|
|
run: |
|
|
latexmk -norc -pdf -shell-escape -interaction=nonstopmode -halt-on-error devopsAssignment.tex
|
|
if (-not (Test-Path devopsAssignment.pdf)) {
|
|
throw "Expected PDF was not produced."
|
|
}
|
|
if ((Get-Item devopsAssignment.pdf).Length -le 0) {
|
|
throw "Expected PDF is empty."
|
|
}
|
|
|
|
- name: Upload compiled PDF
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: devops-it-manual-${{ github.run_number }}-${{ github.sha }}
|
|
path: devopsAssignment.pdf
|
|
retention-days: 14
|