Check Internal Links #1100
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: Check Internal Links | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 23 * * *" | |
env: | |
NODE_OPTIONS: --max-old-space-size=4096 | |
jobs: | |
check_links_internal: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install project dependencies | |
run: yarn --prefer-offline | |
- name: Build static site | |
run: yarn build | |
- name: Serve and Check Links | |
# Looks weird, but this works significantly better than running it | |
# through a single node process | |
run: yarn run serve & (sleep 5 && yarn run links:internal) | |
- name: Create Issue From File | |
uses: peter-evans/create-issue-from-file@v3 | |
with: | |
issue-number: 860 | |
title: Internal Link Checker Report (updated daily) | |
content-filepath: ./broken-links.md | |
labels: report, automated issue |