-
Notifications
You must be signed in to change notification settings - Fork 469
48 lines (42 loc) · 1.5 KB
/
Copy pathpr-preview-check.yml
File metadata and controls
48 lines (42 loc) · 1.5 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
48
name: Build PR Preview
on:
pull_request:
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
jobs:
build:
name: Build Preview
# Base retargets need a preview, but title and body edits do not change the site.
if: >-
github.repository == 'ruby/rdoc' &&
(github.event.action != 'edited' || github.event.changes.base)
runs-on: ubuntu-latest
timeout-minutes: 20
# A skipped edit must not cancel an active build for the same PR.
concurrency:
group: pr-preview-build-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
# This job executes untrusted pull request code. It must not receive secrets
# or a token with write access.
- name: Checkout PR code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Setup Ruby
uses: ruby/setup-ruby@a0102e0972be65f351c307e2d64b9314a57c8073 # v1.324.0
with:
ruby-version: '3.4'
bundler-cache: true
- name: Build site
run: bundle exec rake rdoc
- name: Upload preview site
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-preview-site
path: _site/
if-no-files-found: error
retention-days: 1