Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test PR preview workflow using GitHub Actions #922

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
37 changes: 37 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR Preview Deployment

on:
pull_request:
branches:
- main # Trigger on PRs targeting the main branch

jobs:
deploy-preview:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Install dependencies
run: |
gem install bundler
bundle install

- name: Build site
run: bundle exec jekyll build --destination ./_site

- name: Deploy PR Preview
uses: peaceiris/actions-gh-pages@v3
with:
token: ${{ secrets.PAT_TOKEN }}
NPDebs marked this conversation as resolved.
Show resolved Hide resolved
publish_dir: ./_site
publish_branch: gh-pages
allow_empty_commit: true
cname: '' # Omit custom domain for PR previews
Loading