Skip to content

Docs to PDF

Docs to PDF #11

Workflow file for this run

name: Docs to PDF
on:
push:
branches:
- main
paths-ignore:
- "website/static/un-transparency-protocol.pdf"
workflow_dispatch:
jobs:
docs-to-pdf:
name: Generates PDF file from docs
runs-on: ubuntu-latest
permissions:
contents: "write"
actions: "read"
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: npm install -g docs-to-pdf
- name: Generate PDF
run: |
npx docs-to-pdf --initialDocURLs="https://uncefact.github.io/spec-untp/docs/about/" \
--contentSelector="article" \
--paginationSelector="a.pagination-nav__link.pagination-nav__link--next" \
--excludeSelectors=".breadcrumbs,.theme-edit-this-page" \
--outputPDFFilename="website/static/un-transparency-protocol.pdf" \
--coverTitle="UN Transparency Protocol" \
--coverImage="https://uncefact.github.io/spec-untp/img/home-hero.jpg"
- name: commit pdf
run: |
git config user.name github-actions
git config user.email [email protected]
git add website/static/un-transparency-protocol.pdf
git commit -m "chore: update PDF file"
git push