-
Notifications
You must be signed in to change notification settings - Fork 65
37 lines (33 loc) · 952 Bytes
/
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
# .github/workflows/preview.yml
name: Deploy PR previews
concurrency:
group: preview-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
jobs:
deploy-preview:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
steps:
- name: Cached LFS checkout
uses: nschloe/action-cached-lfs-checkout@d481127c3821f9c278a6019c39a108ac7004c133
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 18.x
cache: npm
- name: Install and Build
run: |
npm clean-install
npm run build
env:
BASE_URL: /pr-preview/pr-${{ github.event.number }}
- name: Deploy preview
uses: rossjrw/pr-preview-action@f31d5aa7b364955ea86228b9dcd346dc3f29c408
with:
source-dir: ./build/