@@ -104,50 +104,9 @@ jobs:
104104 bundler-cache : true
105105 working-directory : docs
106106
107- - name : Validate Build Environment
108- run : |
109- echo "🔍 Validating build environment..."
110-
111- # Check Ruby version
112- RUBY_VERSION=$(ruby -e 'puts RUBY_VERSION')
113- echo "Ruby version: $RUBY_VERSION"
114107
115- # Check Bundler version
116- BUNDLER_VERSION=$(bundle --version)
117- echo "Bundler version: $BUNDLER_VERSION"
118-
119- # Verify all gems are installed
120- if bundle check; then
121- echo "✅ All dependencies satisfied"
122- else
123- echo "❌ Missing dependencies"
124- exit 1
125- fi
126- working-directory : docs
127108
128- - name : Update just-the-docs
129- run : bundle update just-the-docs
130- working-directory : docs
131-
132- - name : Verify Jekyll and just-the-docs versions
133- run : |
134- echo "Checking Jekyll version..."
135- JEKYLL_VERSION=$(bundle exec jekyll --version | cut -d' ' -f2)
136- echo "Installed Jekyll version: $JEKYLL_VERSION"
137- EXPECTED_JEKYLL_MIN="4.3.0"
138109
139- if [[ "$(printf '%s\n' "$EXPECTED_JEKYLL_MIN" "$JEKYLL_VERSION" | sort -V | head -n1)" == "$EXPECTED_JEKYLL_MIN" ]]; then
140- echo "✅ Jekyll version is compatible: $JEKYLL_VERSION (>= $EXPECTED_JEKYLL_MIN)"
141- else
142- echo "❌ Jekyll version too old. Got: $JEKYLL_VERSION, Expected: >= $EXPECTED_JEKYLL_MIN"
143- exit 1
144- fi
145-
146- echo "Checking just-the-docs version..."
147- JTD_VERSION=$(bundle list | grep just-the-docs | awk '{print $2}')
148- echo "Installed just-the-docs version: $JTD_VERSION"
149- echo "✅ just-the-docs version verified"
150- working-directory : docs
151110
152111 # === DEPLOY STAGE ===
153112 build-and-deploy :
@@ -169,134 +128,15 @@ jobs:
169128 bundler-cache : true
170129 working-directory : docs
171130
172- - name : Trace Jekyll Build Process
173- run : |
174- echo "=== Jekyll Environment ==="
175- bundle exec jekyll --version
176- bundle list | grep -E "(jekyll|just-the-docs|sass)"
177-
178- echo "=== Jekyll Doctor Diagnosis ==="
179- bundle exec jekyll doctor --trace
180-
181- echo "=== Build Configuration ==="
182- echo "Theme config:"
183- grep -E "^(theme|remote_theme)" _config.yml
184- echo "Baseurl config:"
185- grep -E "^baseurl" _config.yml
186-
187- echo "=== Starting Verbose Build ==="
188- bundle exec jekyll build --baseurl="/node-syslog" --verbose --trace 2>&1 | tee build.log
189-
190- echo "=== Build Log Analysis ==="
191- echo "Theme-related messages:"
192- grep -i "theme\|layout\|sass" build.log || echo "No theme messages found"
193-
194- echo "=== Generated Site Structure ==="
195- find _site -type f -name "*.html" | wc -l
196- find _site -type f -name "*.css" | wc -l
197- find _site -type f -name "*.js" | wc -l
198-
199- echo "=== Critical Files Check ==="
200- for file in index.html _api/index.html; do
201- if [ -f "_site/$file" ]; then
202- echo "✅ _site/$file exists"
203- echo "First 50 lines:"
204- head -50 "_site/$file"
205- echo "---"
206- else
207- echo "❌ _site/$file missing"
208- fi
209- done
210- working-directory : docs
211-
212- - name : Analyze HTML Structure
213- run : |
214- echo "=== HTML Structure Validation ==="
215- for html_file in $(find _site -name "*.html" -type f | head -5); do
216- echo "=== Analyzing: $html_file ==="
217- echo "Has DOCTYPE:"
218- head -1 "$html_file" | grep -i "<!DOCTYPE" && echo "✅" || echo "❌"
219- echo "Has <html>:"
220- grep -q "<html" "$html_file" && echo "✅" || echo "❌"
221- echo "Has <head>:"
222- grep -q "<head" "$html_file" && echo "✅" || echo "❌"
223- echo "Has <body>:"
224- grep -q "<body" "$html_file" && echo "✅" || echo "❌"
225- echo "Has <nav>:"
226- grep -q "<nav" "$html_file" && echo "✅" || echo "❌"
227- echo "Has theme CSS link:"
228- grep -q "just-the-docs.*css\|main.*css" "$html_file" && echo "✅" || echo "❌"
229- echo "---"
230- done
231- working-directory : docs
232-
233- - name : Check Theme Asset Generation
131+ - name : Build Jekyll site
234132 run : |
235- echo "=== Theme Assets Investigation ==="
236- echo "CSS files in _site:"
237- find _site -name "*.css" -type f | sort
238-
239- echo "JS files in _site:"
240- find _site -name "*.js" -type f | sort
241-
242- echo "SASS processing check:"
243- if find _site -name "*.css" | grep -q "just-the-docs"; then
244- echo "✅ just-the-docs CSS found"
245- else
246- echo "❌ just-the-docs CSS missing"
247- echo "All CSS files:"
248- find _site -name "*.css" -exec ls -la {} \;
249- fi
250-
251- echo "Asset directory structure:"
252- find _site/assets -type f 2>/dev/null | head -20 || echo "No assets directory"
133+ bundle exec jekyll build --baseurl="/node-syslog"
253134 working-directory : docs
254135
255136 - name : Add .nojekyll
256137 run : |
257- echo "📁 Adding .nojekyll file..."
258- echo "Current directory: $(pwd)"
259- echo "_site directory contents:"
260- ls -la _site/ || echo "_site directory not found"
261-
262- if [ ! -d "_site" ]; then
263- echo "❌ _site directory does not exist. Jekyll build may have failed."
264- echo "Creating _site directory manually..."
265- mkdir -p _site
266- fi
267-
268138 touch _site/.nojekyll
269- echo "✅ Created _site/.nojekyll"
270-
271- # Remove any conflicting .nojekyll in api directory
272139 rm -f _site/api/.nojekyll
273- echo "✅ Cleaned up api/.nojekyll"
274-
275- echo "Final _site directory contents:"
276- ls -la _site/
277- working-directory : docs
278-
279- - name : Verify build output
280- run : |
281- echo "📁 Generated files:"
282- find _site -type f | head -20
283- echo ""
284- echo "📁 Total files: $(find _site -type f | wc -l)"
285- echo "📁 Total directories: $(find _site -type d | wc -l)"
286-
287- # Check for essential files
288- if [ -f "_site/index.html" ]; then
289- echo "✅ Main index.html found"
290- else
291- echo "❌ Main index.html missing"
292- exit 1
293- fi
294-
295- if [ -f "_site/_api/index.html" ]; then
296- echo "✅ API documentation found"
297- else
298- echo "⚠️ API documentation not found"
299- fi
300140 working-directory : docs
301141
302142 - name : Deploy to GitHub Pages
@@ -309,51 +149,4 @@ jobs:
309149 keep_files : false
310150 # cname: node-syslog.schamane.de
311151
312- - name : Verify Deployment via GitHub API
313- env :
314- GH_TOKEN : ${{ secrets.GH_TOKEN }}
315- run : |
316- echo "=== Checking gh-pages branch ==="
317- gh api repos/${{ github.repository }}/git/refs/heads/gh-pages || echo "gh-pages branch not found"
318-
319- echo "=== Latest deployment commit ==="
320- gh api repos/${{ github.repository }}/commits?sha=gh-pages&per_page=1 | jq -r '.[0].commit.message'
321-
322- echo "=== Checking deployed files via API ==="
323- gh api repos/${{ github.repository }}/git/trees/gh-pages?recursive=1 | jq -r '.tree[] | select(.type == "blob") | .path' | grep -E "\\.(html|css|js)$" | head -20
324-
325- echo "=== Fetching and analyzing deployed index.html ==="
326- gh api repos/${{ github.repository }}/contents/index.html?ref=gh-pages | jq -r '.content' | base64 -d | head -50
327-
328- echo "=== Checking for theme assets in deployment ==="
329- gh api repos/${{ github.repository }}/git/trees/gh-pages?recursive=1 | jq -r '.tree[] | .path' | grep -E "(just-the-docs|main|style).*\\.(css|js)" || echo "No theme assets found"
330152
331- - name : Live Site Validation
332- env :
333- GH_TOKEN : ${{ secrets.GH_TOKEN }}
334- run : |
335- echo "=== Waiting for deployment to propagate ==="
336- sleep 15
337-
338- echo "=== Testing live site ==="
339- SITE_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
340- echo "Testing URL: $SITE_URL"
341-
342- echo "=== Fetching live site HTML ==="
343- curl -s "$SITE_URL" | head -100 | tee live-site.html
344-
345- echo "=== Analyzing live site structure ==="
346- echo "Has DOCTYPE:"
347- grep -i "<!DOCTYPE" live-site.html && echo "✅" || echo "❌"
348-
349- echo "Has <nav> element:"
350- grep "<nav" live-site.html && echo "✅" || echo "❌"
351-
352- echo "Has theme CSS:"
353- grep -E "just-the-docs.*css|main.*css" live-site.html && echo "✅" || echo "❌"
354-
355- echo "Title tag:"
356- grep "<title>" live-site.html || echo "No title found"
357-
358- echo "=== Checking HTTP headers ==="
359- curl -I "$SITE_URL"
0 commit comments