-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (42 loc) · 1.38 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
name: preview-ci
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_TOOLS_DOC_PROJECT_ID }}
on:
push:
branches-ignore:
- main
paths-ignore:
- 'README.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Install dependencies
run: |
node -v
npm -v
npm ci --no-fund
- name: Check Prettier
run: npm run check-format
- name: Set Vercel Token
id: set-vercel-token
run: |
if [ "${{ github.actor }}" = "ErwanDecoster" ]; then
echo "vercel_token=${{ secrets.VERCEL_TOKEN_ERWAN }}" >> $GITHUB_OUTPUT
else
echo "vercel_token=${{ secrets.VERCEL_TOKEN }}" >> $GITHUB_OUTPUT
fi
- name: Vercel deploy to preview
run: |
npm install --global vercel@latest
vercel pull --yes --scope i-exec --token=${{ steps.set-vercel-token.outputs.vercel_token }}
vercel build --scope i-exec --token=${{ steps.set-vercel-token.outputs.vercel_token }}
vercel deploy --prebuilt --scope i-exec --token=${{ steps.set-vercel-token.outputs.vercel_token }}