forked from servo/servo.org
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (60 loc) · 1.65 KB
/
pr.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: build-pr
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Checkout
uses: actions/checkout@v2
- name: Cache Node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ runner.os }}-
npm-
- name: Install Node modules
run: npm install
- name: Sass
run: npm run sass
- name: Sass Reveal.js
run: npm run sass-revealjs
- name: Eleventy
run: |
npx eleventy \
--output='_site/${{ github.head_ref }}' \
--pathprefix='/${{ github.head_ref }}/'
LC_TIME=C date > '_site/${{ github.head_ref }}/.stamp'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
keep_files: true
- name: Deploy link
env:
HEAD_REF: ${{ github.head_ref }}
run: |
echo "Preview link: https://servo.org/$HEAD_REF/" >> $GITHUB_STEP_SUMMARY
add_preview_link:
runs-on: ubuntu-latest
name: Comment preview link in the PR
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Preview link: https://servo.org/${{ github.head_ref }}/