Published on

CV with Markdown, Pandoc and GitHub Actions

Authors
  • avatar
    Name
    Seb
    Twitter

I like to use Open Source tools whenever possible - writing and updating my CV is no exception.

A great tool to write documents is Markdown. It enables us to handle content and formatting in a plain text document. In fact, the source of this blog post is written in Markdown.

This gives us some great benefits - easy to edit with any editor and version-able via git.

From our Markdown source, we can use various tools like pandoc to convert to HTML, PDF and other formats.

That is why I write my CV in Markdown and later convert it to PDF before sending it out.

I set up a GitHub action in my CV repository to convert the Markdown file to PDF everytime there is a new change:

name: Convert and Release PDF

on: push

jobs:
  convert_via_pandoc:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
      - uses: docker://pandoc/latex:2.19.2
        with:
          args: >-
            --standalone
            -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm"
            -o CV.pdf
            CV.md
      - uses: actions/upload-artifact@master
        with:
          name: pdf
          path: CV.pdf

This action uses the Docker Pandoc Latex image to convert the Markdown file to PDF and then uses the built-in actions/upload-artifact@master action to attach the new PDF to the GitHub Action run.

The -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm" tweaks the margin of the PDF document. The default is a bit too narrow for my taste.

Once the GitHub Action run has finished, I can just conveniently download the latest CV.pdf from the GitHub action artifacts.

Summary

Markdown, pandoc and GitHub Actions make for a reliable, convenient and easy to manage foundation to write my CV.