-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (48 loc) · 1.55 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
name: Build & Vercel Preview Deployment
on:
pull_request:
types: [opened, synchronize]
jobs:
build:
name: Build
timeout-minutes: 15
runs-on: ubuntu-latest
environment: Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
ENV_NAME: ${{ vars.ENV_NAME }}
steps:
- name: Print env
run : echo $ENV_NAME
- name: Check out code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Install playwright
run: cd packages/components && npx playwright install --with-deps
- name: Build
run: pnpm build
- name: Test
run: pnpm test
- name: Install Vercel CLI
working-directory: packages/website
run: pnpm install --global vercel@latest
- name: Pull Vercel Environment Information
working-directory: packages/website
run: vercel pull --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
working-directory: packages/website
run: vercel build
- name: Deploy Project Artifacts to Vercel
working-directory: packages/website
run: vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}