Render PDF as PNG in the workflows #2
This file contains 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 Resume | ||
on: push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Roboto fonts | ||
run: sudo apt install -y fonts-roboto | ||
- name: Install Source Han Sans TW fonts | ||
run: | | ||
curl -sL -o SourceHanSansTW.zip https://github.com/adobe-fonts/source-han-sans/releases/latest/download/SourceHanSansTW.zip | ||
unzip -d SourceHanSansTW SourceHanSansTW.zip | ||
cp SourceHanSansTW/SubsetOTF/TW/*.otf /usr/share/fonts/ | ||
fc-cache -fv | ||
- name: Setup Typst | ||
uses: yusancky/setup-typst@v2 | ||
id: setup-typst | ||
with: | ||
version: 'latest' | ||
- name: Print supported fonts | ||
run: typst fonts | ||
- name: Build resume | ||
run: typst compile resume.typ | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: PDF Resume | ||
path: resume.pdf | ||
if-no-files-found: error | ||
render: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- name: Download all workflow run artifacts | ||
uses: actions/download-artifact@v3 | ||
- name: Install poppler-utils | ||
run: sudo apt install -y poppler-utils | ||
- name: Render resume as PNG | ||
run: pdftoppm resume.pdf resume -png | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: PNG Resume | ||
path: *.png | ||
if-no-files-found: error |