-
Notifications
You must be signed in to change notification settings - Fork 144
38 lines (33 loc) · 1.1 KB
/
mintlify-check.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
name: Mintlify Documentation Check
on:
pull_request:
paths:
- 'docs/**' # Only trigger on changes to docs directory
- 'mint.json' # Also trigger on mintlify config changes
jobs:
build-docs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Mintlify
run: npm install -g mintlify
- name: Test documentation
run: |
cd docs
# If mintlify dev has errors, it will exit with status 1
# If it starts successfully, kill it after 5 seconds
timeout 5s mintlify dev || exit_status=$?
if [ $exit_status -eq 124 ]; then
# timeout exit code 124 means the process was killed after starting successfully
echo "Documentation built successfully!"
exit 0
else
echo "Documentation failed to build! Try running `mintlify dev` from the docs dir locally"
exit 1
fi