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 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Add PR preview workflow using GitHub Actions
  • Loading branch information
NPDebs committed Nov 19, 2024
commit f1ea317fb58a1a912edbd1767c7b421bc73092c0
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
Loading