Build and Upload PDF #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Upload PDF | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Prince | |
run: | | |
curl https://www.princexml.com/download/prince-14.2-linux-generic-x86_64.tar.gz -O | |
tar zxf prince-14.2-linux-generic-x86_64.tar.gz | |
cd prince-14.2-linux-generic-x86_64 | |
yes "" | sudo ./install.sh | |
- name: Get current date | |
id: date | |
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Build PDF | |
run: npx docusaurus-prince-pdf -u https://hasura.io/docs/3.0/index/ --output "${{ env.DATE }}.pdf" | |
- name: Upload PDF as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pdf-output | |
path: ${{ env.DATE }}.pdf | |
if-no-files-found: error |