-
-
Notifications
You must be signed in to change notification settings - Fork 111
40 lines (38 loc) · 1.15 KB
/
build-preview.yaml
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
name: "Build Preview Deployment"
on:
pull_request:
types: [opened, synchronize]
jobs:
build-preview:
runs-on: "ubuntu-latest"
name: "Build Preview Site and Upload Build Artifact"
steps:
- name: "checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: "setup pnpm"
uses: "pnpm/action-setup@v4"
- name: "setup node"
uses: "actions/setup-node@v4"
with:
cache: "pnpm"
node-version: 20
- name: "install dependencies"
run: "pnpm install"
- name: "build"
run: "pnpm run build"
env:
CI_ENV: preview
GITHUB_PR_HEAD_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
- name: "copy cloudflare configuration files to build directory"
run: |
cp _headers build/
cp _redirects build/
- name: "upload build artifact"
uses: "actions/upload-artifact@v4"
with:
name: "preview-build"
path: "build"