use node to create pdf #7
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: Create PDF File | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
convert_via_pandoc: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 # this checks out the repo in the ubuntu container | |
- name: "Create a folder called output" | |
working-directory: markdown-resume | |
run: | | |
mkdir output | |
cp resume-stylesheet.css output/resume-stylesheet.css | |
cp resume.md output/${{ github.actor }}-resume.md | |
# Install pandoc and setup pnpm | |
- name: "Install pandoc and setup pnpm" | |
working-directory: markdown-resume | |
run: | | |
wget https://github.com/jgm/pandoc/releases/download/3.0.1/pandoc-3.0.1-1-amd64.deb | |
sudo apt install ./pandoc-3.0.1-1-amd64.deb | |
npm install -g pnpm | |
pnpm install | |
- name: "Convert MD to HTML" | |
working-directory: markdown-resume | |
run: | | |
pandoc resume.md -f markdown -t html -c resume-stylesheet.css -s -o output/${{github.actor}}-resume.html | |
- name: "Convert HTML to PDF" | |
working-directory: markdown-resume | |
run: | | |
node generate-pdf.js | |
- name: "Move PDF to output" | |
working-directory: markdown-resume | |
run: | | |
mv resume.pdf output/${{github.actor}}-resume.pdf | |
- uses: actions/upload-artifact@master | |
with: # basically this will put resume.md, resume.html, resume.pdf and resume-stylesheet.css in a zip file. | |
name: ${{ github.actor }}'s Resume | |
path: markdown-resume/output |