-
Notifications
You must be signed in to change notification settings - Fork 282
42 lines (42 loc) · 1.36 KB
/
links-internal.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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