-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.26 KB
/
latex.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
name: LaTeX to PDF
on: [push, pull_request]
env:
OUTPUT_DIR: "output"
LATEX_ROOT_FILES: |
agb_app_zum_doc_patient.tex
agb_mediquu_connect.tex
agb_app_zum_doc.tex
agb_mediquu_netzmanager.tex
agb_mediquu_chat.tex
avv.tex
nda.tex
jobs:
compile_latex:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Compile LaTeX documents
uses: xu-cheng/latex-action@v2
with:
root_file: ${{ env.LATEX_ROOT_FILES }}
extra_system_packages: "inkscape"
latexmk_shell_escape: true
- name: Create output directory and move PDFs
run: |
mkdir -p ${{ env.OUTPUT_DIR }}
mv ./*.pdf ${{ env.OUTPUT_DIR }}
echo ${{ github.sha }} > ${{ env.OUTPUT_DIR }}/version.txt
- name: Upload PDFs as artifacts
uses: actions/upload-artifact@v4
with:
name: pdfs
path: ${{ env.OUTPUT_DIR }}
upload_to_cdn:
runs-on: ubuntu-latest
needs: compile_latex
steps:
- name: Download PDFs
uses: actions/download-artifact@v4
with:
name: pdfs
path: ${{ env.OUTPUT_DIR }}
- name: Upload to CDN
uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{ env.OUTPUT_DIR }}
destination-dir: ${{ github.sha }}
release_on_cdn:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: compile_latex
steps:
- name: Download PDFs
uses: actions/download-artifact@v4
with:
name: pdfs
path: ${{ env.OUTPUT_DIR }}
- name: Release on CDN
uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{ env.OUTPUT_DIR }}
destination-dir: main
keep-file-fresh: true