-
Notifications
You must be signed in to change notification settings - Fork 23
49 lines (49 loc) · 1.32 KB
/
doc-preview.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
name: Deploy doc previews to GitHub Pages
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
concurrency:
group: "preview-${{ github.ref }}"
cancel-in-progress: false
jobs:
deploy-preview:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Restore cache
uses: actions/cache@v3
with:
path: |
docs/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('docs/**/package-lock.json') }}-${{ hashFiles('docs/**.[jt]s', 'docs/**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('docs/**/package-lock.json') }}-
- name: Install dependencies
run: npm install
- name: Build with Next.js
run: npx --no-install next build
env:
NEXTJS_BASE_PATH: "/serverless-iiif/pr-preview/pr-${{ github.event.number }}"
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./docs/out/