-
Notifications
You must be signed in to change notification settings - Fork 497
Expand file tree
/
Copy pathtest-docs-workflow.sh
More file actions
executable file
·62 lines (55 loc) · 1.84 KB
/
test-docs-workflow.sh
File metadata and controls
executable file
·62 lines (55 loc) · 1.84 KB
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
#!/bin/bash
echo "========================================================"
echo "Testing Documentation GitHub Action Workflow Locally"
echo "========================================================"
# Step 1: Clean up any previous build
echo "Step 1: Cleaning up previous build..."
if [ -d "site" ]; then
echo "Removing existing site directory..."
rm -rf site
fi
echo "Cleanup completed"
echo "========================================================"
# Step 2: Install dependencies
echo "Step 2: Installing dependencies..."
if pip list | grep -q "mkdocs"; then
echo "MkDocs already installed"
else
echo "Installing MkDocs and dependencies..."
pip install -r requirements.txt
fi
echo "Dependencies installation completed"
echo "========================================================"
# Step 3: Build the site
echo "Step 3: Building MkDocs site..."
mkdocs build
if [ $? -eq 0 ]; then
echo "MkDocs site built successfully"
else
echo "Error building MkDocs site"
exit 1
fi
echo "========================================================"
# Step 4: Verify the site structure
echo "Step 4: Verifying site structure..."
if [ -d "site" ]; then
echo "Site directory exists"
echo "Files in site directory:"
ls -la site
else
echo "Error: Site directory not found"
exit 1
fi
echo "========================================================"
# Step 5: Test serving the site locally
echo "Step 5: Testing local server (will run for 5 seconds)..."
mkdocs serve &
SERVER_PID=$!
sleep 5
kill $SERVER_PID
echo "Local server test completed"
echo "========================================================"
echo "Documentation workflow test completed successfully!"
echo "To view the site locally, run: mkdocs serve"
echo "To deploy to GitHub Pages, push changes to the main branch"
echo "========================================================"