-
Notifications
You must be signed in to change notification settings - Fork 4
160 lines (118 loc) · 3.63 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
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: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Java
uses: actions/setup-java@v4
with:
java-version: 11
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: v3.0
path: tinylog
- name: Generate API documentation
run: |
cd tinylog
mvn -P release --non-recursive --no-transfer-progress --batch-mode javadoc:javadoc
- name: Copy API documentation
run: |
rm -r public/v3/javadoc/*
cp -R tinylog/target/site/apidocs/* public/v3/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-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
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/v3
pages_path: public
cmd_params: "--exclude=(tinylog.org/(v[^3]|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"