Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write

Expand All @@ -27,8 +27,8 @@ concurrency:
cancel-in-progress: false

jobs:
# Build job
build:
# Build and deploy job
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -40,26 +40,16 @@ jobs:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
run: bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3

# Deployment job
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
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
publish_branch: gh-pages
# Keep existing files (preserves PR preview directories)
keep_files: true
45 changes: 45 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Workflow for deploying PR previews to GitHub Pages
name: Deploy PR Preview

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

# Sets permissions of the GITHUB_TOKEN
permissions:
contents: write
pull-requests: write

# Prevent concurrent deployments for the same PR
concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
if: github.event.action != 'closed'

- name: Setup Ruby
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
if: github.event.action != 'closed'
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0

- name: Build with Jekyll
if: github.event.action != 'closed'
run: bundle exec jekyll build --baseurl "/pr-preview/pr-${{ github.event.number }}"
env:
JEKYLL_ENV: production

- name: Deploy PR Preview
uses: rossjrw/pr-preview-action@v1.6.3
with:
source-dir: ./_site/
Loading