-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-workflow.sh
More file actions
executable file
·64 lines (50 loc) · 1.49 KB
/
test-workflow.sh
File metadata and controls
executable file
·64 lines (50 loc) · 1.49 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
63
64
#!/bin/bash
# Test GitHub Actions Workflow Locally
# This script simulates the GitHub Actions workflow steps
echo "🧪 Testing GitHub Actions workflow locally..."
# Step 1: Checkout (simulated)
echo "✅ Step 1: Checkout - Already in repository"
# Step 2: Setup Node.js (simulated)
echo "✅ Step 2: Setup Node.js - Using local Node.js"
# Step 3: Install dependencies
echo "📦 Step 3: Installing dependencies..."
npm ci
if [ $? -ne 0 ]; then
echo "❌ Step 3 failed: npm ci"
exit 1
fi
# Step 4: Build project
echo "🔨 Step 4: Building project..."
npm run build
if [ $? -ne 0 ]; then
echo "❌ Step 4 failed: npm run build"
exit 1
fi
# Step 5: Verify build output
echo "🔍 Step 5: Verifying build output..."
if [ ! -d "out" ]; then
echo "❌ Step 5 failed: 'out' directory not found"
exit 1
fi
echo "✅ Step 5: Build output verified"
echo "📁 Contents of out/ directory:"
ls -la out/
# Step 6: Check for essential files
echo "🔍 Step 6: Checking for essential files..."
if [ ! -f "out/index.html" ]; then
echo "❌ Step 6 failed: index.html not found"
exit 1
fi
if [ ! -f "out/404.html" ]; then
echo "❌ Step 6 failed: 404.html not found"
exit 1
fi
echo "✅ Step 6: Essential files found"
echo ""
echo "🎉 All workflow steps passed!"
echo "📋 Ready for GitHub Actions deployment"
echo ""
echo "📝 Next steps:"
echo " 1. Push this code to GitHub"
echo " 2. Enable GitHub Pages in repository settings"
echo " 3. The workflow will automatically deploy"