forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (101 loc) · 3.71 KB
/
website-validation.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Website validation
on:
pull_request:
types: [ opened, synchronize, reopened ]
paths:
- "docs/**"
defaults:
run:
working-directory: ./docs
permissions:
pull-requests: read
jobs:
build_site:
runs-on: ubuntu-latest
name: Build site
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3
with:
submodules: false
- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # ratchet:pnpm/action-setup@v2
with:
version: "^7"
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # ratchet:actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: Build site artifact
run: |
pnpm i --frozen-lockfile
npm run ci:build
- name: Upload site artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # ratchet:actions/upload-artifact@v3
with:
name: fluidframework-site
path: docs/public
retention-days: 3
lint:
runs-on: ubuntu-latest
name: pnpm lint
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3
with:
submodules: false
- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # ratchet:pnpm/action-setup@v2
with:
version: "^7"
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # ratchet:actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: pnpm lint
run: |
pnpm i --frozen-lockfile
pnpm lint
broken_link_check:
runs-on: ubuntu-latest
name: 🔗 Broken Link Check
needs: build_site
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3
with:
submodules: false
- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # ratchet:pnpm/action-setup@v2
with:
version: "^7"
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # ratchet:actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: Create results folder
run: mkdir -p ./results
- name: Download site artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # ratchet:actions/download-artifact@v3
with:
name: fluidframework-site
path: docs/public
- name: Install dependencies
run: "pnpm i --frozen-lockfile"
- name: Check for broken links
id: linkcheck
continue-on-error: true
run: |
set -o pipefail
pnpm run ci:linkcheck | tee ./results/linkcheck-output.txt
- name: Save PR number
run: echo ${{ github.event.number }} > ./results/pr
- name: Save linkcheck report
run: |
cat "$GITHUB_WORKSPACE/.github/workflows/data/linkcheck-${{ steps.linkcheck.outcome }}.md" | tee ./results/linkcheck
echo -e "\n#### linkcheck output\n\n\`\`\`" | tee -a ./results/linkcheck
cat ./results/linkcheck-output.txt | tee -a ./results/linkcheck
echo -e "\n\`\`\`" | tee -a ./results/linkcheck
- name: Upload results artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # ratchet:actions/upload-artifact@v3
with:
name: website-validation-results
path: ./docs/results
retention-days: 3