fix: deploy #20
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: Deploy Jekyll site to Pages | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1.225.0 | |
| with: | |
| ruby-version: '3.1' | |
| bundler-cache: true | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build Site | |
| uses: actions/jekyll-build-pages@v1.0.13 | |
| - name: Clean and Sanitize Build Output | |
| run: | | |
| # Create a clean directory | |
| mkdir -p clean_site | |
| # Use plain copy (no symlinks) to copy files | |
| echo "Creating a clean copy of the site..." | |
| cp -r _site/* clean_site/ || echo "Copy failed - checking issue" | |
| # Check for any problematic files in the clean directory | |
| echo "Checking for symlinks..." | |
| find clean_site -type l -ls || echo "No symlinks found" | |
| # Check for hard links - files with more than 1 link | |
| echo "Checking for hard links..." | |
| find clean_site -type f -links +1 -ls || echo "No hard links found" | |
| # Show directory size | |
| echo "Directory size:" | |
| du -sh clean_site | |
| # Remove _site and rename clean_site to _site | |
| rm -rf _site | |
| mv clean_site _site | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: github-pages | |
| path: "_site" | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4.0.5 | |
| with: | |
| artifact_name: github-pages |