# GitHub Action for Jekyll
#
# Runs jekyll build on master and pushes output to gh-pages branch.
# (Then GitHub deploys that static content.)

name: Build & Deploy to GitHub Pages

on:
  push:
    branches:
      - master

jobs:
  github-pages:
    runs-on: ubuntu-latest
    container: ruby:2-buster
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}

      - name: Install Ruby dependencies.
        run: |
          gem install bundler
          bundle install

      - name: Build static site with Jekyll.
        run: bundle exec jekyll build

      - name: Deploy static site to gh-pages branch.
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./_site

# GitHub Action for Jekyll
#
# Runs jekyll build on master and pushes output to gh-pages branch.
# (Then GitHub deploys that static content.)

name: Build & Deploy to GitHub Pages

on:
  push:
    branches:
      - master

jobs:
  github-pages:
    runs-on: ubuntu-latest
    container: ruby:2-buster
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}

      - name: Install Ruby dependencies.
        run: |
          gem install bundler
          bundle install --path vendor/bundle 

      - name: Build static site with Jekyll.
        run: bundle exec jekyll build

      - name: Deploy static site to gh-pages branch.
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./_site

Install gems to vendor/bundle during CI build
Install gems to vendor/bundle during CI build

When we build the site using GitHub Actions, we should install gems to
vendor/bundler. We already have a build step to cache that directory to
save time on future builds.

Fixes #39
