-
Notifications
You must be signed in to change notification settings - Fork 11
63 lines (51 loc) · 1.7 KB
/
markdown-to-pdf.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
## Code
name: Markdown to PDF
on:
push:
branches:
- main
paths:
- '1_1_vulns/translations/**'
pull_request:
branches:
- main
paths:
- '1_1_vulns/translations/**'
env:
LANGUAGES: '["de", "it", "pt", "hi", "zh"]' # Add or remove language codes as needed
jobs:
convert-markdown-to-pdf:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Using Node.js version 20
- name: Configure locale
run: |
sudo locale-gen en_US.UTF-8
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV
- name: Install necessary fonts
run: |
sudo apt-get update
sudo apt-get install -y fonts-noto fonts-noto-cjk fonts-noto-color-emoji fonts-indic fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core
- name: Install md-to-pdf
run: npm install -g md-to-pdf
- name: Run markdown_to_pdf.sh for each language
run: |
for lang in $(echo $LANGUAGES | jq -r '.[]'); do
./markdown_to_pdf.sh --language $lang
done
working-directory: ./markdown-to-pdf
- name: Get current date and time
id: date
run: echo "date=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_ENV
- name: Upload generated PDFs as artifact
uses: actions/upload-artifact@v4
with:
name: pdf-translations-zipfile-${{ env.date }}
path: ./markdown-to-pdf/generated/*.pdf