forked from platformsh/platformsh-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.39 KB
/
pr-check-links.yaml
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
name: Check internal links
on:
pull_request:
branches: [main]
types: [opened,reopened,synchronize,labeled,unlabeled]
jobs:
check-internal-links:
name: Check internal links
runs-on: ubuntu-latest
strategy:
matrix:
site: ['platform', 'upsun']
# Run only for PRs from default repo and approved PRs from forks
if: github.event.pull_request.head.repo.id == 21975579 || contains(github.event.pull_request.labels.*.name, 'build-fork')
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
cache-dependency-path: sites/${{ matrix.site }}/package-lock.json
- name: Install dependencies
run: |
cd sites/${{ matrix.site }}
npm ci
- name: Build search script
run: |
cd sites/${{ matrix.site }}
npm run build:search
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.125.0'
- name: Build Hugo site
run: |
cd sites/${{ matrix.site }}
hugo
- name: Minify assets
run: |
cd sites/${{ matrix.site }}
- name: Check links in Markdown
run: |
set -e
cd sites/${{ matrix.site }}
curl https://htmltest.wjdp.uk | bash
bin/htmltest