-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
49 lines (40 loc) · 934 Bytes
/
.gitlab-ci.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
image: node:latest
stages:
- install
- test
- deploy
cache:
paths:
- node_modules/
install:
stage: install
script:
- npm install --legacy-peer-deps
test:
stage: test
dependencies:
- install
script:
- npm run test
lint:
stage: test
dependencies:
- install
script:
- npm run format
- npm run lint
deploy:
stage: deploy
variables:
PREVIEW_URL: rindr-$CI_COMMIT_REF_SLUG.$VERCEL_USER.vercel.app
VERCEL_ORG_ID: $VERCEL_ORG_ID
VERCEL_PROJECT_ID: $VERCEL_PROJECT_ID
rules:
- if: $CI_COMMIT_BRANCH == 'main'
environment:
name: vercel/$CI_COMMIT_REF_NAME
url: https://$PREVIEW_URL
script:
- npm i -g vercel
- DEPLOYMENT_URL=$(VERCEL_ORG_ID=$VERCEL_ORG_ID VERCEL_PROJECT_ID=$VERCEL_PROJECT_ID vercel --confirm -t $VERCEL_TOKEN --scope $VERCEL_SCOPE)
- vercel alias set $DEPLOYMENT_URL $PREVIEW_URL -t $VERCEL_TOKEN --scope $VERCEL_SCOPE