-
Notifications
You must be signed in to change notification settings - Fork 4
209 lines (152 loc) · 4.64 KB
/
build.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Build
on:
- push
- pull_request
jobs:
pre-checks:
name: Resolve Pre-Checks
runs-on: ubuntu-24.04
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
steps:
- name: Print Info
run: |
echo "Branch push or external pull request detected"
build:
name: Build Website
runs-on: ubuntu-24.04
needs: pre-checks
outputs:
timestamp: ${{ steps.timestamp.outputs.timestamp }}
steps:
- name: Checkout Website Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Resolve tinylog Version
run: |
pip3 install yq
echo "TINYLOG_VERSION=$(yq -r '.params.stableVersion' config.yaml)" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Java
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
- name: Install Dependencies
run: npm install
- name: Build Website
run: npm run build:prod
- name: Checkout tinylog Repository
uses: actions/checkout@v4
with:
repository: tinylog-org/tinylog
ref: ${{ env.TINYLOG_VERSION }}
path: tinylog
- name: Generate API documentation
run: |
cd tinylog/tinylog-api
mvn -P release --no-transfer-progress --batch-mode javadoc:javadoc
- name: Copy API documentation
run: |
rm -r public/javadoc/*
cp -R tinylog/tinylog-api/target/site/apidocs/* public/javadoc
- name: Generate timestamp
id: timestamp
run: echo "timestamp=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
- name: Upload Generated Files
uses: actions/upload-artifact@v4
with:
name: website-${{ steps.timestamp.outputs.timestamp }}
path: public/
lint-sass:
name: Lint SASS
runs-on: ubuntu-24.04
needs: pre-checks
steps:
- name: Checkout Website Repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm install
- name: Run Stylelint
run: npm run stylelint:check
lint-typescript:
name: Lint Typescript
runs-on: ubuntu-24.04
needs: pre-checks
steps:
- name: Checkout Website Repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm install
- name: Run ESLint
run: npm run eslint:check
lint-markdown:
name: Lint Markdown
runs-on: ubuntu-24.04
needs: pre-checks
steps:
- name: Checkout Website Repository
uses: actions/checkout@v4
- name: Check Markdown
uses: DavidAnson/markdownlint-cli2-action@v19
with:
globs: "content/**/*.md"
check-spelling:
name: Check Spelling
runs-on: ubuntu-24.04
needs: pre-checks
steps:
- name: Checkout Website Repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm install
- name: Run CSpell
run: npm run cspell:check
validate-html:
name: Validate HTML
runs-on: ubuntu-24.04
needs: build
steps:
- name: Download Generated Files
uses: actions/download-artifact@v4
with:
name: website-${{ needs.build.outputs.timestamp }}
path: public/
- name: Validate HTML
uses: Cyb3r-Jak3/[email protected]
with:
log_level: INFO
skip_git_check: true
root: public/
blacklist: javadoc google179accde67aec4e2.html
check-links:
name: Check Links
runs-on: ubuntu-24.04
needs: build
steps:
- name: Download Generated Files
uses: actions/download-artifact@v4
with:
name: website-${{ needs.build.outputs.timestamp }}
path: public/
- name: Check Links
uses: ruzickap/action-my-broken-link-checker@v2
with:
url: https://tinylog.org
pages_path: public
cmd_params: "--exclude=(tinylog.org/p2-repository/|github.com/tinylog-org/website/edit/) --max-connections-per-host=2 --rate-limit=10 --accepted-status-codes=200,403 --buffer-size=8192 --color=always"