forked from cloudliner/cricleci-orb
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfirebase-deploy.yml
108 lines (108 loc) · 3.13 KB
/
firebase-deploy.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
version: 2.1
description: Orb for deploying to Firebase.
commands:
deploy:
description: Deploy to Firebase
parameters:
token:
type: string
description: Firebase Deploy Token
alias:
type: string
default: "default"
description: Firebase project alias to deploy to
steps:
- run:
name: Install Firebase Tools
command: npm install --prefix=./firebase-deploy firebase-tools
- run:
name: Deploy to Firebase
command: ./firebase-deploy/node_modules/.bin/firebase deploy --token=<< parameters.token >> -P << parameters.alias >>
examples:
default:
description: Deploying to your "default" Firebase project alias
usage:
version: 2.1
orbs:
firebase-deploy: azdevs/firebase-deploy@1.0.0
jobs:
build:
docker:
- image: circleci/node:lts
steps:
- checkout
- restore_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: yarn build
- persist_to_workspace:
root: /tmp/workspace
paths:
- dist
- firebase.json
- .firebaserc
- firestore.rules
- firestore.indexes.json
deploy:
docker:
- image: circleci/node:lts
steps:
- attach_workspace:
at: /tmp/workspace
- firebase-deploy/deploy:
token: $FIREBASE_DEPLOY_TOKEN
workflows:
build-and-deploy:
jobs:
- build
- deploy:
requires:
- build
alias:
description: Deploying to a custom Firebase project alias
usage:
version: 2.1
orbs:
firebase-deploy: azdevs/firebase-deploy@1.0.0
jobs:
build:
docker:
- image: circleci/node:lts
steps:
- checkout
- restore_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: yarn build
- persist_to_workspace:
root: /tmp/workspace
paths:
- dist
- firebase.json
- .firebaserc
- firestore.rules
- firestore.indexes.json
deploy:
docker:
- image: circleci/node:lts
steps:
- attach_workspace:
at: /tmp/workspace
- firebase-deploy/deploy:
token: $FIREBASE_DEPLOY_TOKEN
alias: staging # name of an alias from your .firebaserc
workflows:
build-and-deploy:
jobs:
- build
- deploy:
requires:
- build