Skip to content

Merge pull request #4 from k-kom/feature/impl-health-endpoint #25

Merge pull request #4 from k-kom/feature/impl-health-endpoint

Merge pull request #4 from k-kom/feature/impl-health-endpoint #25

Workflow file for this run

name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: lein deps
- name: Build ClojureScript
run: lein cljsbuild once
- name: Test pdfshot
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
PDFSHOT_PORT: 8000
run: |
sudo mkdir -p /usr/share/fonts/truetype/
curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
curl -O https://jaist.dl.osdn.jp/users/8/8634/genshingothic-20150607.7z
7z x -aoa -ogenshingothic genshingothic-20150607.7z
sudo mv genshingothic/*.ttf /usr/share/fonts/truetype/
rm -rf genshingothic genshingothic-20150607.7z
sudo fc-cache -fv
sudo mkdir -p /app/print
sudo cp target/pdfshot.js /app
cd /app
sudo -E npm install puppeteer@19.4.1 express@4.18.2
sudo -E node pdfshot.js --no-sandbox &
cd $GITHUB_WORKSPACE
sleep 10
curl -fsLJO "localhost:$PDFSHOT_PORT/print.pdf?target=https%3A%2F%2Fexample.com"
pgrep node | sudo xargs kill
[[ "$(file print.pdf)" == "print.pdf: PDF document, version 1.4, 1 pages" ]]