Skip to content

Generate PDF KO

Generate PDF KO #7

Workflow file for this run

name: Generate PDF
on:
workflow_dispatch:
inputs:
name:
description: "Deployment?"
default: "WhaTap"
permissions:
contents: write
env:
PRINCE_VER: 15.3
jobs:
build-n-deploy:
name: Generate PDF
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Install Prince
run: |
curl https://www.princexml.com/download/prince-${{ env.PRINCE_VER }}-macos.zip -O
tar zxf prince-${{ env.PRINCE_VER }}-macos.zip
cd prince-${{ env.PRINCE_VER }}-macos
yes "" | sudo ./install.sh
- name: Install pdfcpu
run: brew install pdfcpu
- name: Build PDF
run: |
npx docusaurus-prince-pdf -u https://docs.whatap.io/cover-url --prince-args="--page-size='a4' --page-margin='10mm' --style='custom.css'" -o ./pdf/whatap-url-monitoring.pdf --dest ./pdf --include-index
pdfcpu annot remove -pages 1 ./pdf/whatap-url-monitoring.pdf
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# with:
# tag_name: v1.0.0 # 생성할 Release의 태그 이름
# release_name: "PDF Release"
# body: "자동 생성된 PDF 파일을 포함한 Release입니다."
# draft: false
# prerelease: false
- name: Upload to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pdf/whatap-url-monitoring.pdf
asset_name: whatap-url-monitoring.pdf
asset_content_type: application/pdf