use weasyprint #4
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 weasyprint | |
- name: "Install pandoc and weasyprint" | |
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 | |
sudo apt-get update | |
sudo apt-get install -y python3-pip | |
pip3 install weasyprint | |
- 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: | | |
weasyprint output/${{github.actor}}-resume.html 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 |