Merge branch 'modernize-jekyll-infrastructure' #3
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 and deploy Jekyll site | |
| on: | |
| push: | |
| branches: ["main"] | |
| 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.4" | |
| bundler-cache: true | |
| - name: Persist Gemfile.lock if missing | |
| run: | | |
| if ! git ls-files --error-unmatch Gemfile.lock >/dev/null 2>&1; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Gemfile.lock | |
| git commit -m "Add Gemfile.lock for reproducible builds" || true | |
| git push || true | |
| fi | |
| continue-on-error: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Lint Markdown | |
| run: bundle exec rake markdown_lint | |
| - name: Lint SCSS | |
| run: npm run stylelint | |
| - name: Build with Jekyll | |
| run: bundle exec jekyll build | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Run HTML Proofer | |
| run: bundle exec rake html_proofer | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| 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 |