Scheduled Broken Links Checker #6
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: Scheduled Broken Links Checker | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
# Configure Ruby to build Jekyll site | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
- name: Ruby gem cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- name: Bundle Setup | |
run: bundle config path ${{ github.workspace }}/vendor/bundle | |
- name: Bundle Install | |
run: bundle install --jobs 4 --retry 3 | |
# Configure Node to build assets | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
# Build the Docs | |
- name: Build Docs | |
run: | | |
npm ci | |
./node_modules/.bin/gulp build | |
- name: Run site | |
run: | | |
npm install -g wait-on netlify-cli | |
netlify dev & wait-on http://localhost:8888 | |
- name: Run link checker | |
run: | | |
cd tools/broken-link-checker | |
npm ci | |
node full.js --host http://localhost:8888 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |