web/.github/workflows/ci.yml
Cotes Chung b985965bc9 Fix bundle-install failed on gh-actions.
`--local` option of bundle-install:
  if an appropriate platform-specific gem exists on rubygems.org it will not be found.

see: <https://bundler.io/v2.1/man/bundle-install.1.html>
2020-11-23 02:03:15 +08:00

62 lines
1.3 KiB
YAML

name: 'Continuous Integration'
on:
push:
branches-ignore:
- 'production'
tags-ignore:
- '*'
paths-ignore:
- '.github/**'
- '!.github/workflows/ci.yml'
- '.travis.yml'
- '.gitignore'
- 'docs/**'
- 'README.md'
- 'LICENSE'
pull_request:
paths:
- '**'
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
env:
GEMS_PATH: ~/vendor/bundle
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # for posts's lastmod
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Bundle Caching
uses: actions/cache@v2
with:
path: ${{ env.GEMS_PATH }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle Install
run: |
bundle config path ${{ env.GEMS_PATH }}
bundle install --jobs 4 --retry 3
- name: Build Site
env:
JEKYLL_ENV: production
run: |
bundle exec jekyll b
- name: Test Site
run: |
bash tools/test.sh