-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (75 loc) · 2.6 KB
/
deploy-to-vercel.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Deploy Customer Zero to Vercel
on:
pull_request:
push:
branches:
- master
- release
jobs:
checks:
name: checks
runs-on: ubuntu-22.04
timeout-minutes: 3
strategy:
matrix:
node-version: [21.x]
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn checks
deploy-preview:
name: deploy to vercel preview
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release'
runs-on: ubuntu-22.04
needs:
- checks
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@master
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.GITHUB_TOKEN }} # Optional
vercel-org-id: ${{ secrets.VERCEL_METABOAT_ORG_ID }} # Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} # Required
scope: ${{ secrets.VERCEL_METABOAT_ORG_ID }} # Required when deploying to team account
deploy-staging:
name: deploy to vercel staging
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
needs:
- checks
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@master
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.GITHUB_TOKEN }} # Optional
vercel-org-id: ${{ secrets.VERCEL_METABOAT_ORG_ID }} # Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} # Required
scope: ${{ secrets.VERCEL_METABOAT_ORG_ID }} # Required when deploying to team account
deploy-production:
name: deploy to vercel production
if: github.ref == 'refs/heads/release'
runs-on: ubuntu-22.04
needs:
- checks
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@master
with:
github-comment: false
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.GITHUB_TOKEN }} # Optional
vercel-args: "--prod"
vercel-org-id: ${{ secrets.VERCEL_METABOAT_ORG_ID }} # Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} # Required
scope: ${{ secrets.VERCEL_METABOAT_ORG_ID }} # Required when deploying to team account