Skip to content

Commit

Permalink
add automatic pdf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
marieALaporte authored Dec 10, 2024
1 parent b092448 commit d1c3185
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/deploy-to-github-pages.yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -51,3 +51,36 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

# Add a new job to build the PDF
generate_pdf:
runs-on: ubuntu-latest
needs: deploy # Ensures this job runs after 'deploy'
steps:
- uses: actions/checkout@v4

- 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: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm ci

- name: Build PDF
run: npx docusaurus-prince-pdf -u https://agrdatasci.github.io/documentation/

- name: Upload PDF artifact
uses: actions/upload-artifact@v3
with:
name: documentation-pdf
path: pdf/tricot-documentation-book.pdf
if-no-files-found: error

0 comments on commit d1c3185

Please sign in to comment.