-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (41 loc) · 1.17 KB
/
pr-build-preview.yml
File metadata and controls
47 lines (41 loc) · 1.17 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
44
45
46
47
name: PR Build (Preview Artifact)
#
# IMPORTANT: Do NOT rename this workflow unless you also update
# the 'workflows:' array in pr-deploy-preview.yml
#
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
concurrency:
group: pr-build-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
JEKYLL_ENV: production
steps:
- name: Checkout PR Head
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ruby
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
with:
ruby-version: '3.3.6'
bundler-cache: true
cache-version: 0
- name: Build site
run: |
echo "Building preview for PR #$PR_NUMBER"
bundle exec jekyll build --baseurl "/pr-preview/pr-${PR_NUMBER}"
- name: Upload preview artifact
uses: actions/upload-artifact@v4
with:
name: pr-preview-site-${{ env.PR_NUMBER }}
path: _site
if-no-files-found: error
retention-days: 7