-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
66 lines (61 loc) · 998 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
stages:
- compile
- build
- deploy
cache:
paths:
- node_modules/
key: '$CI_COMMIT_REF_SLUG'
compile_app:
image: node:16.13.2
stage: compile
tags:
- docker
before_script:
- yarn
script:
- yarn type-check
build_app:
image: node:16.13.2
stage: build
variables:
VITE_API_BASE_URL: ''
tags:
- docker
before_script:
- yarn
script:
- yarn build
after_script:
- echo $(date) >> "dist/static/buildTime.txt"
artifacts:
expire_in: 2 days
paths:
- dist
only:
refs:
- branches
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
.deploy:
stage: deploy
needs:
- build_app
cache: {}
before_script:
- whoami
script:
- 'sudo rm -rf $STATIC_DIR/*'
- echo "Deleted remote build"
- 'sudo cp -r dist/* $STATIC_DIR/'
deploy:dev:
variables:
STATIC_DIR: /var/www/sundaram/dev
tags:
- sundaram-shell
stage: deploy
extends:
- .deploy
only:
refs:
- main