Skip to content

Generate PDF KO

Generate PDF KO #12

Workflow file for this run

name: Generate PDF KO
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: Install gh
run: brew install gh
- name: Build PDF
run: |
npx docusaurus-prince-pdf -u https://docs.whatap.io/cover-awscloudwatch --prince-args="--javascript --page-size='a4' --page-margin='10mm' --style='$PATH_NAME/print.css'" -o ./pdf/whatap-amazon-cloudwatch.pdf --dest ./pdf --include-index
pdfcpu annot remove -pages 1 ./pdf/whatap-amazon-cloudwatch.pdf
npx docusaurus-prince-pdf -u https://docs.whatap.io/cover-awsecs --prince-args="--javascript --page-size='a4' --page-margin='10mm' --style='$PATH_NAME/print.css'" -o ./pdf/whatap-amazon-ecs.pdf --dest ./pdf --include-index
pdfcpu annot remove -pages 1 ./pdf/whatap-amazon-ecs.pdf
npx docusaurus-prince-pdf -u https://docs.whatap.io/cover-azure --prince-args="--javascript --page-size='a4' --page-margin='10mm' --style='$PATH_NAME/print.css'" -o ./pdf/whatap-azure.pdf --dest ./pdf --include-index
pdfcpu annot remove -pages 1 ./pdf/whatap-azure.pdf
npx docusaurus-prince-pdf -u https://docs.whatap.io/cover-ncloud --prince-args="--javascript --page-size='a4' --page-margin='10mm' --style='$PATH_NAME/print.css'" -o ./pdf/whatap-ncloud.pdf --dest ./pdf --include-index
pdfcpu annot remove -pages 1 ./pdf/whatap-ncloud.pdf
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.WHATAP_DOCS_TOKEN }}
with:
tag_name: v2.11.0 # 생성할 Release의 태그 이름
release_name: "v2.11.0_KO"
body: "WhaTap Docs v2.11.0 기준으로 생성되 PDF 파일입니다."
draft: false
prerelease: false
- name: Upload PDFs using GitHub CLI
run: |
gh release upload v2.11.0_KO pdf/*.pdf
env:
GITHUB_TOKEN: ${{ secrets.WHATAP_DOCS_TOKEN }}
# - name: Upload to Release
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.WHATAP_DOCS_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: pdf/whatap-apm-java-monitoring.pdf
# asset_name: whatap-apm-java-monitoring.pdf
# asset_content_type: application/pdf