1+ name : CI Build
2+
3+ on :
4+ # Trigger on all pull requests to validate builds
5+ pull_request :
6+ branches : [ main ]
7+ paths-ignore :
8+ - ' **.md'
9+ - ' LICENSE'
10+ - ' SECURITY.md'
11+
12+ # Trigger on pushes to branches (but not main, which is handled by deploy workflow)
13+ push :
14+ branches-ignore : [ main ]
15+ paths-ignore :
16+ - ' **.md'
17+ - ' LICENSE'
18+ - ' SECURITY.md'
19+
20+ # Allow only one concurrent CI run per branch/PR
21+ concurrency :
22+ group : " ci-${{ github.head_ref || github.ref }}"
23+ cancel-in-progress : true
24+
25+ permissions :
26+ contents : read
27+
28+ jobs :
29+ # Build validation job
30+ build :
31+ runs-on : ubuntu-latest
32+ steps :
33+ - name : Checkout
34+ uses : actions/checkout@v4
35+
36+ - name : Setup Node
37+ uses : actions/setup-node@v4
38+ with :
39+ node-version : " 18"
40+ cache : ' npm'
41+
42+ - name : Install dependencies
43+ run : npm install
44+
45+ - name : Lint code
46+ run : npm run lint
47+
48+ - name : Run tests
49+ run : npm run test:run
50+
51+ - name : Build application
52+ run : npm run build
53+
54+ - name : Build for GitHub Pages
55+ run : npm run build:pages
56+
57+ - name : Validate build outputs
58+ run : |
59+ echo "Validating standard build..."
60+ if [ ! -f "dist/index.html" ]; then
61+ echo "❌ Standard build failed: dist/index.html not found"
62+ exit 1
63+ fi
64+ echo "✅ Standard build output validated"
65+
66+ echo "Validating GitHub Pages build..."
67+ if [ ! -f "dist/index.html" ]; then
68+ echo "❌ GitHub Pages build failed: dist/index.html not found"
69+ exit 1
70+ fi
71+ echo "✅ GitHub Pages build output validated"
72+
73+ - name : Report build success
74+ run : |
75+ echo "🎉 CI Build completed successfully!"
76+ echo "✅ Linting passed (with warnings allowed)"
77+ echo "✅ All $( npm run test:run 2>&1 | grep -o '[0-9]\+ passed' | head -1 ) tests passed"
78+ echo "✅ Standard build completed"
79+ echo "✅ GitHub Pages build completed"
0 commit comments