-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.5 KB
/
client-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
name: PR - Client Preview
on:
pull_request:
branches:
- master
- '!release-please**'
paths:
- 'client/**'
jobs:
deploy-vercel:
name: Vercel
runs-on: ubuntu-latest
if: contains(fromJson('["ved-bot"]'), github.actor) == false
env:
VERCEL_TOKEN: '${{ secrets.VERCEL_TOKEN }}'
VERCEL_ORG_ID: '${{ vars.VERCEL_ORG_ID }}'
VERCEL_PROJECT_ID: '${{ vars.VERCEL_PROJECT_ID }}'
steps:
- name: Check Vercel Token
if: env.VERCEL_TOKEN == ''
run: |
echo 'The owner of this repository didn't set the VERCEL_TOKEN secret!'
exit 1
- name: Check Vercel Org ID
if: env.VERCEL_ORG_ID == ''
run: |
echo 'The owner of this repository didn't set the VERCEL_ORG_ID secret!'
exit 1
- name: Check Vercel Project ID
if: env.VERCEL_PROJECT_ID == ''
run: |
echo 'The owner of this repository didn't set the VERCEL_PROJECT_ID secret!'
exit 1
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Deploy Preview to Vercel
id: vercel-action
uses: amondnet/vercel-action@v25
with:
github-token: '${{ secrets.GH_BOT_TOKEN }}'
vercel-token: '${{ secrets.VERCEL_TOKEN }}'
vercel-org-id: '${{ vars.VERCEL_ORG_ID }}'
vercel-project-id: '${{ vars.VERCEL_PROJECT_ID }}'
- name: preview-url
run: |
echo ${{ steps.vercel-action.outputs.preview-url }}