Add Jekyll CI #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Jekyll Site | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Build with Jekyll | |
| id: jekyll-build | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: . | |
| destination: ./_site | |
| future: false | |
| build_revision: ${{ github.sha }} | |
| verbose: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check for build warnings | |
| run: | | |
| echo "Checking for potential Jekyll warnings..." | |
| # Check for YAML front matter issues in markdown files | |
| YAML_ERRORS=0 | |
| find . -name "*.md" -not -path "./_site/*" -not -path "./vendor/*" -not -path "./docs/external/*" | while read file; do | |
| if head -20 "$file" | grep -q "^---$" && head -20 "$file" | tail -n +2 | grep -q "^---$"; then | |
| # File has front matter, check for common YAML issues | |
| FRONT_MATTER=$(awk '/^---$/{if(NF==1 && !f) f=NR; if(f && NR>f) exit} f && NR>f{print}' "$file") | |
| if echo "$FRONT_MATTER" | grep -E '^\s*[^:]+\s+[^:]+\s*$'; then | |
| echo "Potential YAML syntax issue in $file" | |
| echo "$FRONT_MATTER" | grep -E '^\s*[^:]+\s+[^:]+\s*$' | head -3 | |
| YAML_ERRORS=$((YAML_ERRORS + 1)) | |
| fi | |
| fi | |
| done | |
| # Check for common Jekyll configuration issues | |
| if grep -q "baseurl.*github.io" _config.yml 2>/dev/null; then | |
| echo "Warning: baseurl may contain github.io domain - this might cause issues with custom domains" | |
| fi | |
| echo "Warning check completed" | |
| - name: Test build artifacts | |
| run: | | |
| if [ ! -d "_site" ]; then | |
| echo "Jekyll build failed - _site directory not created" | |
| exit 1 | |
| fi | |
| if [ ! -f "_site/index.html" ]; then | |
| echo "Jekyll build failed - index.html not generated" | |
| exit 1 | |
| fi | |
| echo "Jekyll build completed successfully" |