Deploy Jekyll site to Pages #413
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"] | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3.6' | |
| bundler-cache: true | |
| - name: Set up Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build with Jekyll | |
| run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Debug list cache location | |
| run: | | |
| echo "Working directory: $(pwd)" | |
| find . -maxdepth 3 -type d -name ".jekyll-cache" -print | |
| ls -R .jekyll-cache || echo "No local cache found" | |
| - name: Upload rebuilt site artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| webmention: | |
| runs-on: ubuntu-latest | |
| needs: deploy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3.6' | |
| bundler-cache: true | |
| - name: Rebuild with Jekyll | |
| run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Send webmentions with Jekyll | |
| run: bundle exec jekyll webmention | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Commit .jekyll-cache to repo | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add -f .jekyll-cache | |
| git commit -m "Update .jekyll-cache" || echo "No changes to commit" | |
| git push | |
| - name: Print Jekyll webmention cache | |
| run: ls -lh .jekyll-cache && cat .jekyll-cache/webmention_io_*.yml || true | |
| - name: Upload updated .jekyll-cache | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jekyll-cache-after-webmention | |
| include-hidden-files: true | |
| path: .jekyll-cache | |
| if-no-files-found: error | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |