I’m a little sad about that title but not really.

This site runs on GitLab Pages with its own custom domain and CloudFlare SSL certificate. Read this page if setting that up is something that interests you; it’s actually quite easy to do.

I recommend using Jekyll as your static site generator as it’s fast, easy, and all of your pages are in Markdown. GitLab actually keeps a pretty good template here that you can clone and make your own. For the most part, that’s exactly what this site is running, aside from some heavy modification of the minima theme that comes with Jekyll.

Though it is pretty easy to get that off the ground, it’s easy to gloss over what that template does. Importantly, it has a .gitlab-ci.yml file which tells GitLab how to build your site from its Jekyll source. It turns out that you can do a bit more with that, though. The .gitlab-ci.yml in the template has a property on the job that builds the site that says stage: deploy:

pages:
  stage: deploy
  script:
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master

By default, there are three stages for which you can define jobs in .gitlab-ci.yml files: build, test, and deploy. Jobs defined as part of those stages run in that order. I decided it would be cool to have GitLab build and host my resume, too, such that any changes I make are automatically reflected on my website. Copying things over is for the birds.

I can do this by migrating my resume repository to resume/ in my cfoust.gitlab.io repository and build it as follows:

# Builds my resume first.
resume:
  stage: build

  # This is a huge image (3GB) and takes a bit to pull.
  image: blang/latex:ubuntu

  # This saves any files not tracked by Git into
  # an archive for the `deploy` step.
  artifacts:
    untracked: true

  script:
    - cd resume && xelatex "CV.tex"

# Then builds the whole site.
pages:
  stage: deploy

  # The crucial line. This means that the artifacts
  # from the resume step are unzipped into the build
  # environment of this step.
  dependencies:
    - resume

  image: ruby:2.3

  cache:
    paths:
      - vendor/

  before_script:
    - bundle install --path vendor

  script:
    - bundle exec jekyll build -d public/
    - mv resume/CV.pdf public/assets/resume.pdf

  artifacts:
    paths:
      - public
  only:
    - master # this job will affect only the 'master' branch

Now the link to my resume on my home page is always up to date! Awesome!