generated from NYU-ITS/repo-settings-test-1
-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (37 loc) · 1019 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
38
39
40
41
42
43
44
45
# .github/workflows/preview.yml
name: Deploy PR previews
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
permissions: write-all
# Re-edit this to see what's needed
#permissions:
# pull-requests: write
# contents: write
# pages: write
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- run: echo "PREVIEW_PATH=pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV"
- name: Install and Build
if: github.event.action != 'closed' # Skip the build if the PR has been closed
run: |
pnpm install --frozen-lockfile
pnpm run build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
preview-branch: gh-pages
source-dir: build
umbrella-dir: pr-preview
action: auto