-
-
Notifications
You must be signed in to change notification settings - Fork 67
108 lines (89 loc) · 3.66 KB
/
build.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Ensure Site Builds Cleanly
on:
push:
branches: [ master ]
jobs:
build-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GraphicsMagick
run: sudo apt install graphicsmagick
- name: Install Chrome
run: |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- name: Restore node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules
- name: Restore Asset Cache
uses: actions/cache@v2
with:
key: if-cache
path: |
./if-cache/*
./if-cache.json
./twitter-cache.json
- name: Install node dependencies
run: npm ci
- name: Lint JS code
run: npm test
- name: Build site
run: npm run build
- name: (EN) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/en.pdf" \
http://127.0.0.1:8080/en/printable/index.html
- name: (ZH) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/zh.pdf" \
http://127.0.0.1:8080/zh/printable/index.html
- name: (DE) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/de.pdf" \
http://127.0.0.1:8080/de/druckbar/index.html
- name: (HU) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/hu.pdf" \
http://127.0.0.1:8080/hu/nyomtathato/index.html
- name: (PL) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/pl.pdf" \
http://127.0.0.1:8080/pl/do-druku/index.html
- name: (PT) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/pt.pdf" \
http://127.0.0.1:8080/pt/imprimivel/index.html
- name: (FR) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/fr.pdf" \
http://127.0.0.1:8080/fr/a-imprimer/index.html
- name: (NL) Generate PDF from HTML
run: |
google-chrome --headless --print-to-pdf-no-header \
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/nl.pdf" \
http://127.0.0.1:8080/nl/afdrukbaar/index.html
- name: List dist
run: ls -la ${{ github.workspace }}/dist
- name: Upload PDFs
uses: actions/upload-artifact@v3
with:
name: site-pdfs
path: |
${{ github.workspace }}/dist/**.pdf