-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.18 KB
/
deploy.yml
File metadata and controls
43 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Deploy PR Preview to GitHub Pages
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
# Checkout PR branch
- name: Checkout PR branch
uses: actions/checkout@v3
with:
fetch-depth: 1
# Set up Ruby and install Bundler
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.8
# Install dependencies (Jekyll and Bundler)
- name: Install dependencies
run: |
gem install bundler -v 2.4.22
bundle install
# Build the Jekyll site with preview-specific baseurl
- name: Build the site with Jekyll
run: |
echo "baseurl: '/mcsmip.github.io/preview/${{ github.event.pull_request.number }}'" >> _config.yml
bundle exec jekyll build
# Deploy to GitHub Pages Preview
- name: Deploy to GitHub Pages Preview
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./_site
publish_branch: gh-pages
destination_dir: preview/${{ github.event.pull_request.number }}