-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (59 loc) · 1.88 KB
/
pdf_builder.yml
File metadata and controls
69 lines (59 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build Report PDF
on:
push:
branches: [ "main" ]
paths-ignore:
- 'report/**'
- '.github/workflows/pdf_builder.yml'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Pandoc and LaTeX
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
- name: Create build directory
run: mkdir -p report/build
- name: Convert Markdown to PDF
run: |
pandoc report/report.md \
--from markdown+raw_html \
--to pdf \
--output report/build/BSc_group_b.pdf \
--resource-path report \
--pdf-engine=pdflatex \
--variable geometry:margin=1in \
--variable fontsize=11pt \
--variable urlcolor=blue \
--variable linkcolor=black
- name: Verify PDF was created
run: |
if [ ! -f report/build/BSc_group_b.pdf ]; then
echo "PDF was not created!"
exit 1
fi
echo "PDF created successfully: $(du -h report/build/BSc_group_b.pdf | cut -f1)"
- name: Upload PDF artifact
uses: actions/upload-artifact@v4
with:
name: project-report
path: report/build/BSc_group_b.pdf
retention-days: 90
- name: Create Pull Request with updated PDF
uses: peter-evans/create-pull-request@v6
with:
commit-message: "ci: update report PDF [skip ci]"
title: "ci: update report PDF"
body: "Automated update of the project report PDF."
branch: "update-report-pdf"
base: main
signoff: false
labels: |
automated-pr