Skip to content

Commit 483c509

Browse files
Dale KunceDale Kunce
authored andcommitted
Add comprehensive site asset verification to deployment workflow
- Verify critical CSS, JavaScript, and font files exist and have reasonable sizes - Check for essential pages (home, about, beginner, host, blog) - Validate all language versions (en, es, fr, cs) are built - Display build summary with total files and size - Fail deployment if any critical assets are missing - Provides detailed logging for troubleshooting build issues
1 parent ad8e624 commit 483c509

1 file changed

Lines changed: 76 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,85 @@ jobs:
3838
run: npm run lint
3939

4040
- name: Build site
41-
run: |
42-
npm run build
43-
echo "=== Build completed, checking for CSS files ==="
44-
ls -la _site/assets/styles/ || echo "No _site/assets/styles directory found"
45-
find _site -name "main.css" -type f || echo "No main.css found in _site"
41+
run: npm run build
4642
env:
4743
JEKYLL_ENV: production
4844

45+
- name: Verify site assets
46+
run: |
47+
echo "=== Verifying critical site assets ==="
48+
49+
# Check for CSS files
50+
if [ ! -f "_site/assets/styles/main.css" ]; then
51+
echo "❌ CRITICAL: main.css not found"
52+
exit 1
53+
else
54+
echo "✅ main.css found ($(wc -c < _site/assets/styles/main.css) bytes)"
55+
fi
56+
57+
# Check for JavaScript files
58+
if [ ! -f "_site/assets/scripts/main.min.js" ]; then
59+
echo "❌ CRITICAL: main.min.js not found"
60+
exit 1
61+
else
62+
echo "✅ main.min.js found ($(wc -c < _site/assets/scripts/main.min.js) bytes)"
63+
fi
64+
65+
# Check for essential fonts
66+
FONT_COUNT=$(find _site/assets/fonts -name "*.woff2" 2>/dev/null | wc -l)
67+
if [ "$FONT_COUNT" -lt 3 ]; then
68+
echo "❌ CRITICAL: Missing fonts (found $FONT_COUNT, expected at least 3)"
69+
exit 1
70+
else
71+
echo "✅ Fonts found ($FONT_COUNT .woff2 files)"
72+
fi
73+
74+
# Check for favicon
75+
if [ ! -f "_site/assets/graphics/favicon/favicon.ico" ]; then
76+
echo "❌ WARNING: favicon.ico not found"
77+
else
78+
echo "✅ favicon.ico found"
79+
fi
80+
81+
# Check for critical pages
82+
CRITICAL_PAGES=("index.html" "about/index.html" "beginner/index.html" "host/index.html" "blog/index.html")
83+
for page in "${CRITICAL_PAGES[@]}"; do
84+
if [ ! -f "_site/$page" ]; then
85+
echo "❌ CRITICAL: Page $page not found"
86+
exit 1
87+
else
88+
echo "✅ Page $page found"
89+
fi
90+
done
91+
92+
# Check for language versions
93+
LANGUAGES=("en" "es" "fr" "cs")
94+
for lang in "${LANGUAGES[@]}"; do
95+
if [ "$lang" = "en" ]; then
96+
# English is at root
97+
if [ ! -f "_site/index.html" ]; then
98+
echo "❌ CRITICAL: English homepage not found"
99+
exit 1
100+
fi
101+
else
102+
if [ ! -f "_site/$lang/index.html" ]; then
103+
echo "❌ CRITICAL: $lang homepage not found"
104+
exit 1
105+
else
106+
echo "✅ $lang homepage found"
107+
fi
108+
fi
109+
done
110+
111+
# Summary statistics
112+
TOTAL_FILES=$(find _site -type f | wc -l)
113+
TOTAL_SIZE=$(du -sh _site | cut -f1)
114+
echo ""
115+
echo "=== Build Summary ==="
116+
echo "Total files: $TOTAL_FILES"
117+
echo "Total size: $TOTAL_SIZE"
118+
echo "✅ All critical assets verified successfully"
119+
49120
- name: Upload build artifacts
50121
uses: actions/upload-artifact@v4
51122
with:

0 commit comments

Comments
 (0)