-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
86 lines (74 loc) · 1.63 KB
/
.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
default:
image: mrkobhrai/node14-firebase-tools:latest
stages:
- Install Dependencies
- Style Check
- Build Frontend
- Deploy
frontend-dependencies:
stage: Install Dependencies
script:
- cd react-frontend
- npm ci
cache:
untracked: true
key: "$CI_COMMIT_BRANCH-frontend"
paths:
- react-frontend/node_modules/
artifacts:
paths:
- react-frontend/node_modules/
backend-dependencies:
stage: Install Dependencies
script:
- cd functions
- npm ci
cache:
untracked: true
key: "$CI_COMMIT_BRANCH-backend"
paths:
- functions/node_modules/
artifacts:
paths:
- functions/node_modules/
frontend-style-check:
stage: Style Check
script:
- cd react-frontend
- eslint .
needs: ["frontend-dependencies"]
artifacts:
paths:
- react-frontend/node_modules/
backend-style-check:
stage: Style Check
script:
- cd functions
- eslint .
needs: ["backend-dependencies"]
artifacts:
paths:
- functions/node_modules/
build-frontend:
stage: Build Frontend
script:
- cd react-frontend
- npm run build
artifacts:
paths:
- react-frontend/build
needs: ["frontend-style-check"]
deploy-frontend:
stage: Deploy
script:
- firebase deploy --only hosting --token "${FIREBASE_DEPLOY_TOKEN}"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
needs: ["build-frontend", "backend-style-check"]
deploy-backend:
stage: Deploy
script:
- firebase deploy --only functions --token "${FIREBASE_DEPLOY_TOKEN}"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
needs: ["build-frontend", "backend-style-check"]