2022-04-24 16:36:18 -07:00
|
|
|
name: Ensure Site Builds Cleanly
|
2022-04-24 04:23:39 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
2022-04-24 16:36:18 -07:00
|
|
|
build-site:
|
2022-04-24 04:23:39 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: Install GraphicsMagick
|
|
|
|
run: sudo apt install graphicsmagick
|
2022-04-24 04:23:39 +02:00
|
|
|
|
2022-06-24 10:58:50 -07:00
|
|
|
- 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
|
|
|
|
|
2022-04-24 04:23:39 +02:00
|
|
|
- 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
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: Restore Asset Cache
|
2022-04-24 04:23:39 +02:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
key: if-cache
|
|
|
|
path: |
|
2022-06-24 10:52:54 -07:00
|
|
|
./if-cache/*
|
2022-04-24 04:23:39 +02:00
|
|
|
./if-cache.json
|
|
|
|
./twitter-cache.json
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: Install node dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Lint JS code
|
|
|
|
run: npm test
|
|
|
|
|
|
|
|
- name: Build site
|
2022-04-24 04:23:39 +02:00
|
|
|
run: npm run build
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: (EN) Generate PDF from HTML
|
2022-04-24 04:23:39 +02:00
|
|
|
run: |
|
|
|
|
google-chrome --headless --print-to-pdf-no-header \
|
2022-06-24 10:52:54 -07:00
|
|
|
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/en.pdf" \
|
2022-04-24 04:23:39 +02:00
|
|
|
http://127.0.0.1:8080/en/printable/index.html
|
2022-04-24 16:36:18 -07:00
|
|
|
|
|
|
|
- name: (ZH) Generate PDF from HTML
|
2022-04-24 04:23:39 +02:00
|
|
|
run: |
|
|
|
|
google-chrome --headless --print-to-pdf-no-header \
|
2022-06-24 10:52:54 -07:00
|
|
|
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/zh.pdf" \
|
2022-04-24 04:23:39 +02:00
|
|
|
http://127.0.0.1:8080/zh/printable/index.html
|
2022-04-24 16:36:18 -07:00
|
|
|
|
|
|
|
- name: (DE) Generate PDF from HTML
|
2022-04-24 04:23:39 +02:00
|
|
|
run: |
|
|
|
|
google-chrome --headless --print-to-pdf-no-header \
|
2022-06-24 10:52:54 -07:00
|
|
|
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/de.pdf" \
|
2022-04-24 04:23:39 +02:00
|
|
|
http://127.0.0.1:8080/de/druckbar/index.html
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: (HU) Generate PDF from HTML
|
2022-04-24 04:23:39 +02:00
|
|
|
run: |
|
|
|
|
google-chrome --headless --print-to-pdf-no-header \
|
2022-06-24 10:52:54 -07:00
|
|
|
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/hu.pdf" \
|
2022-04-24 04:23:39 +02:00
|
|
|
http://127.0.0.1:8080/hu/nyomtathato/index.html
|
2022-04-24 16:36:18 -07:00
|
|
|
|
|
|
|
- name: (PL) Generate PDF from HTML
|
2022-04-24 04:23:39 +02:00
|
|
|
run: |
|
|
|
|
google-chrome --headless --print-to-pdf-no-header \
|
2022-06-24 10:52:54 -07:00
|
|
|
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/pl.pdf" \
|
2022-04-24 04:23:39 +02:00
|
|
|
http://127.0.0.1:8080/pl/do-druku/index.html
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: (FR) Generate PDF from HTML
|
2022-04-24 04:23:39 +02:00
|
|
|
run: |
|
|
|
|
google-chrome --headless --print-to-pdf-no-header \
|
2022-06-24 10:52:54 -07:00
|
|
|
--run-all-compositor-stages-before-draw --print-to-pdf="${{ github.workspace }}/dist/fr.pdf" \
|
2022-04-24 16:36:18 -07:00
|
|
|
http://127.0.0.1:8080/fr/a-imprimer/index.html
|
2022-04-24 04:23:39 +02:00
|
|
|
|
2022-06-24 10:58:50 -07:00
|
|
|
- name: List dist
|
|
|
|
run: ls -la ${{ github.workspace }}/dist
|
|
|
|
|
2022-04-24 16:36:18 -07:00
|
|
|
- name: Upload PDFs
|
2022-04-24 04:23:39 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2022-04-24 16:36:18 -07:00
|
|
|
name: site-pdfs
|
2022-04-24 04:23:39 +02:00
|
|
|
path: |
|
2022-06-24 11:27:17 -07:00
|
|
|
${{ github.workspace }}/dist/**.pdf
|