Build site and check links with htmlproofer #235
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 site and check links with htmlproofer | |
on: | |
push: | |
branches: | |
- '*' | |
schedule: | |
- cron: '12 0 * * 0' # Run every sunday at 12:00 | |
env: | |
BUILD_DIR: .build | |
jobs: | |
htmlproofer: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: 2.6 | |
- name: Cache bundler dependencies | |
uses: actions/cache@v1 | |
id: gems | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- name: Install bundler | |
run: | | |
gem install bundler | |
bundle config path vendor/bundle | |
- name: Install bundler dependencies | |
if: steps.gems.outputs.cache-hit != 'true' | |
run: | | |
bundle install --jobs 4 --retry 3 | |
- name: Build site | |
run: make build | |
- name: Test external links (no fail) | |
run: FLAGS="--log-level=debug --external-only" make htmlproofer || true | |
- name: Test internal links | |
run: FLAGS="--log-level=debug --disable-external" make htmlproofer |