forked from aws-amplify/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (57 loc) · 1.83 KB
/
check_for_broken_links.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: LinkChecker
on:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
LinkChecker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup Node.js 16.x
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: 16.x
- name: Install Dependencies
run: yarn
- name: Run Build
run: yarn build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Serve Files
uses: Eun/http-server-action@6befadcf3bf8d9a4fcc563c1ffba0e59f188a1e5 # v1.0.10 https://github.com/Eun/http-server-action/commit/6befadcf3bf8d9a4fcc563c1ffba0e59f188a1e5
with:
directory: ${{vars.BUILD_DIR}}
port: 3000
no-cache: false
index-files: |
["index.html", "index.htm"]
allowed-methods: |
["GET", "HEAD"]
content-types: |
{
"appcache": "text/cache-manifest",
"css": "text/css",
"gif": "image/gif",
"html": "text/html",
"ico": "image/x-icon",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"js": "text/javascript",
"json": "application/json",
"png": "image/png",
"txt": "text/plain",
"xml": "text/xml"
}
log: "log.txt"
logTime: "false"
- name: Run Link Checker
id: checkLinks
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
result-encoding: string
script: |
const { checkDevLinks } = require('./tasks/link-checker.js');
return await checkDevLinks();