-
Notifications
You must be signed in to change notification settings - Fork 8
146 lines (135 loc) · 5.22 KB
/
check-links-in-prod.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# This workflow verifies hyperlinks using the deployed
# docs site. It has to be triggered manually.
name: Check links
on:
workflow_dispatch: {}
schedule:
- cron: '39 0 20 * *' # every 20th of the month at 00:39
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- name: Pull image
run: docker pull ghcr.io/linkchecker/linkchecker:latest
- name: Create output folder
run: |
mkdir -p output
chmod 777 output
- name: check-links-in-overview-pages
run: |
docker run --rm --name linkchecker \
--volume ${PWD}/output:/workdir --workdir /workdir \
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/overview/ \
--check-extern \
--threads 1 \
--recursion-level 2 \
--no-status \
--file-output html/utf8/overview.html \
|| echo "failed1=true" >> "$GITHUB_ENV"
continue-on-error: true
- name: check-links-in-getting-started-pages
run: |
docker run --rm --name linkchecker \
--volume ${PWD}/output:/workdir --workdir /workdir \
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/getting-started/ \
--check-extern \
--threads 1 \
--recursion-level 2 \
--no-status \
--file-output html/utf8/getting-started.html \
|| echo "failed2=true" >> "$GITHUB_ENV"
continue-on-error: true
- name: check-links-in-tutorials-pages
run: |
docker run --rm --name linkchecker \
--volume ${PWD}/output:/workdir --workdir /workdir \
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/tutorials/ \
--check-extern \
--threads 1 \
--recursion-level 2 \
--no-status \
--file-output html/utf8/tutorials.html \
|| echo "failed3=true" >> "$GITHUB_ENV"
continue-on-error: true
- name: check-links-in-reference-pages
run: |
docker run --rm --name linkchecker \
--volume ${PWD}/output:/workdir --workdir /workdir \
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/reference/ \
--check-extern \
--threads 1 \
--recursion-level 2 \
--no-status \
--file-output html/utf8/reference.html \
|| echo "failed4=true" >> "$GITHUB_ENV"
continue-on-error: true
- name: check-links-in-support-pages
run: |
docker run --rm --name linkchecker \
--volume ${PWD}/output:/workdir --workdir /workdir \
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/support/ \
--check-extern \
--threads 1 \
--recursion-level 2 \
--no-status \
--file-output html/utf8/support.html \
|| echo "failed5=true" >> "$GITHUB_ENV"
continue-on-error: true
- name: check-links-in-changelogs
run: |
docker run --rm --name linkchecker \
--volume ${PWD}/output:/workdir --workdir /workdir \
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/changes/ \
--threads 1 \
--recursion-level 2 \
--no-status \
--file-output html/utf8/changes.html \
--ignore-url="^https://github.com/giantswarm/docs/.*" \
--ignore-url="^https://.*example\.com/.*" \
--ignore-url="^https://my-org\.github\.com/.*" \
--ignore-url="^https://github\.com/giantswarm/giantswarm/.*" \
--ignore-url=".*gigantic\.io.*" \
|| echo "failed6=true" >> "$GITHUB_ENV"
continue-on-error: true
- name: Store reports as artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.2
with:
name: link-check-reports
path: ./output
if-no-files-found: warn
retention-days: 14
- name: Report errors
run: |
if [[ $failed1 == "true" ]]; then
echo "There has been some errors in overview checks, please check the step."
failed=true
fi
if [[ $failed2 == "true" ]]; then
echo "There has been some errors in getting started checks, please check the step."
failed=true
fi
if [[ $failed3 == "true" ]]; then
echo "There has been some errors in tutorials checks, please check the step."
failed=true
fi
if [[ $failed4 == "true" ]]; then
echo "There has been some errors in reference checks, please check the step."
failed=true
fi
if [[ $failed5 == "true" ]]; then
echo "There has been some errors in support checks, please check the step."
failed=true
fi
if [[ $failed6 == "true" ]]; then
echo "There has been some errors in changelogs checks, please check the step."
failed=true
fi
if [[ $failed == "true" ]]; then
exit 1
fi