File tree 13 files changed +4891
-74
lines changed
13 files changed +4891
-74
lines changed Original file line number Diff line number Diff line change
1
+ version : 2.1 # use CircleCI 2.1
2
+
3
+ executors :
4
+ node-project :
5
+ working_directory : ~/tmp
6
+ docker :
7
+ - image : circleci/node:12.12.0
8
+
9
+ jobs : # a collection of steps
10
+ install_deps : # install npm deps
11
+ executor : node-project
12
+ steps :
13
+ - checkout
14
+ - restore_cache : # special step to restore the dependency cache
15
+ key : dependency-cache-{{ checksum "package-lock.json" }}
16
+ - run :
17
+ name : Install NPM Dependencies
18
+ command : npm i
19
+ - save_cache : # special step to save the dependency cache
20
+ key : dependency-cache-{{ checksum "package-lock.json" }}
21
+ paths :
22
+ - ~/tmp/node_modules
23
+
24
+ build : # build the project - requires dependencies to have been installed
25
+ executor : node-project
26
+ steps :
27
+ - checkout
28
+ - restore_cache :
29
+ key : dependency-cache-{{ checksum "package-lock.json" }}
30
+ - run : # run build
31
+ name : Build
32
+ command : |
33
+ npm run build
34
+ - store_artifacts : # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
35
+ path : public
36
+ prefix : public
37
+ - save_cache : # special step to save the public cache and deploy files
38
+ key : deploy-cache-{{ .Environment.CIRCLE_WORKFLOW_ID }}
39
+ paths :
40
+ - ~/tmp/public
41
+ - ~/tmp/.firebaserc
42
+ - ~/tmp/firebase.json
43
+ - ~/tmp/package-lock.json
44
+
45
+ deploy_to_firebase : # deploy the project to prod - SHOULD ONLY BE RUN ON MASTER BRANCH
46
+ executor : node-project
47
+ steps :
48
+ - restore_cache : # restore the /public folder and associated deploy files
49
+ key : deploy-cache-{{ .Environment.CIRCLE_WORKFLOW_ID }}
50
+ - restore_cache : # special step to restore the dependency cache
51
+ key : dependency-cache-{{ checksum "package-lock.json" }}
52
+ - run :
53
+ name : Deploy to Firebase Hosting
54
+ command : ./node_modules/.bin/firebase deploy --token "$FIREBASE_TOKEN"
55
+
56
+ workflows :
57
+ version : 2
58
+ build_and_deploy :
59
+ jobs :
60
+ - install_deps
61
+ - build :
62
+ requires :
63
+ - install_deps
64
+ - deploy_to_firebase :
65
+ filters :
66
+ branches :
67
+ only : master
68
+ requires :
69
+ - build
Original file line number Diff line number Diff line change @@ -63,3 +63,6 @@ node_modules/
63
63
64
64
# dotenv environment variables file
65
65
.env
66
+
67
+ # Public output
68
+ public /
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
{
2
2
"hosting" : {
3
- "public" : " ." ,
3
+ "public" : " ./public " ,
4
4
"ignore" : [
5
5
" firebase.json" ,
6
6
" **/.*" ,
You can’t perform that action at this time.
0 commit comments