Skip to content

Commit

Permalink
Add PR preview workflow using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
NPDebs committed Nov 19, 2024
1 parent 63a94be commit f1ea317
Showing 1 changed file with 37 additions and 0 deletions.
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:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
publish_branch: gh-pages
allow_empty_commit: true
cname: '' # Omit custom domain for PR previews

0 comments on commit f1ea317

Please sign in to comment.