Skip to content

Commit 9c2cfcc

Browse files
committed
Deploy directly to Firebase hosting (#50)
* set up deploys directly from this repo * trigger circle build * fix circle config * update deploy script * use correct publish directory
1 parent dce9f60 commit 9c2cfcc

File tree

2 files changed

+99
-37
lines changed

2 files changed

+99
-37
lines changed

.circleci/config.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
version: 2.1
2+
jobs:
3+
build_changelog:
4+
docker:
5+
- image: node:10
6+
resource_class: "xlarge"
7+
environment:
8+
- TERM: dumb
9+
steps:
10+
- checkout
11+
- restore_cache:
12+
key: changelog-dependency-cache-v3-{{ checksum "yarn.lock" }}
13+
- run:
14+
name: 'Install changelog dependencies'
15+
command: "yarn install --frozen-lockfile"
16+
- save_cache:
17+
key: changelog-dependency-cache-v3-{{ checksum "yarn.lock" }}
18+
paths:
19+
- node_modules
20+
- run:
21+
name: 'Build'
22+
command: |
23+
PUBLIC_PATH=/changelog/ yarn build
24+
- persist_to_workspace:
25+
root: ./
26+
paths:
27+
- node_modules
28+
- build/
29+
- firebase.json
30+
- .firebaserc
31+
- index.js
32+
- package.json
33+
deploy:
34+
docker:
35+
- image: node:10
36+
environment:
37+
- TERM: dumb
38+
steps:
39+
- attach_workspace:
40+
at: ./
41+
- run:
42+
name: 'Deploy to Firebase'
43+
command: |
44+
yarn firebase-deploy-directory --project onegraph-dashboard --subpath changelog --directory build/public/ --commit --token "$FIREBASE_TOKEN"
45+
yarn firebase deploy --debug -P prod --only functions --token "$FIREBASE_TOKEN"
46+
47+
staging_deploy:
48+
docker:
49+
- image: node:10
50+
environment:
51+
- TERM: dumb
52+
steps:
53+
- attach_workspace:
54+
at: ./
55+
- run:
56+
name: 'Deploy to Firebase'
57+
command: |
58+
yarn firebase-deploy-directory --project oph-dashboard-staging --subpath changelog --directory build/public/ --commit --token "$FIREBASE_TOKEN"
59+
yarn firebase deploy --debug -P staging --only functions --token "$FIREBASE_TOKEN"
60+
61+
workflows:
62+
version: 2.1
63+
build-deploy:
64+
jobs:
65+
- build_changelog
66+
- deploy:
67+
requires:
68+
- build_changelog
69+
filters:
70+
branches:
71+
only: master
72+
- staging_deploy:
73+
requires:
74+
- build_changelog
75+
filters:
76+
branches:
77+
ignore: master

yarn.lock

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,11 +1302,6 @@
13021302
"@types/node" "*"
13031303
"@types/responselike" "*"
13041304

1305-
"@types/color-name@^1.1.1":
1306-
version "1.1.1"
1307-
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
1308-
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
1309-
13101305
"@types/events@*":
13111306
version "3.0.0"
13121307
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
@@ -1617,9 +1612,9 @@ agent-base@4, agent-base@^4.2.0, agent-base@^4.3.0:
16171612
es6-promisify "^5.0.0"
16181613

16191614
agent-base@6:
1620-
version "6.0.2"
1621-
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77"
1622-
integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==
1615+
version "6.0.0"
1616+
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.0.tgz#5d0101f19bbfaed39980b22ae866de153b93f09a"
1617+
integrity sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==
16231618
dependencies:
16241619
debug "4"
16251620

@@ -1741,15 +1736,7 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1:
17411736
dependencies:
17421737
color-convert "^1.9.0"
17431738

1744-
ansi-styles@^4.0.0:
1745-
version "4.2.1"
1746-
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359"
1747-
integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==
1748-
dependencies:
1749-
"@types/color-name" "^1.1.1"
1750-
color-convert "^2.0.1"
1751-
1752-
ansi-styles@^4.1.0:
1739+
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
17531740
version "4.3.0"
17541741
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
17551742
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
@@ -2470,9 +2457,9 @@ bluebird@~3.4.1:
24702457
integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=
24712458

24722459
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0:
2473-
version "4.11.9"
2474-
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
2475-
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==
2460+
version "4.11.8"
2461+
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
2462+
integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==
24762463

24772464
bn.js@^5.1.1:
24782465
version "5.1.3"
@@ -2687,9 +2674,9 @@ buffer-from@^1.0.0:
26872674
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
26882675

26892676
buffer-indexof-polyfill@~1.0.0:
2690-
version "1.0.2"
2691-
resolved "https://registry.yarnpkg.com/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz#d2732135c5999c64b277fcf9b1abe3498254729c"
2692-
integrity sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==
2677+
version "1.0.1"
2678+
resolved "https://registry.yarnpkg.com/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz#a9fb806ce8145d5428510ce72f278bb363a638bf"
2679+
integrity sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8=
26932680

26942681
buffer-indexof@^1.0.0:
26952682
version "1.1.1"
@@ -3819,12 +3806,12 @@ [email protected]:
38193806
dependencies:
38203807
ms "2.0.0"
38213808

3822-
debug@4, debug@^4.1.0:
3823-
version "4.2.0"
3824-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
3825-
integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
3809+
debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
3810+
version "4.1.1"
3811+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
3812+
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
38263813
dependencies:
3827-
ms "2.1.2"
3814+
ms "^2.1.1"
38283815

38293816
debug@^3.1.0, debug@^3.2.5, debug@^3.2.6:
38303817
version "3.2.6"
@@ -3833,13 +3820,6 @@ debug@^3.1.0, debug@^3.2.5, debug@^3.2.6:
38333820
dependencies:
38343821
ms "^2.1.1"
38353822

3836-
debug@^4.0.1, debug@^4.1.1:
3837-
version "4.1.1"
3838-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
3839-
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
3840-
dependencies:
3841-
ms "^2.1.1"
3842-
38433823
decamelize@^1.1.1, decamelize@^1.2.0:
38443824
version "1.2.0"
38453825
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
@@ -5631,7 +5611,7 @@ got@^10.5.7:
56315611
to-readable-stream "^2.0.0"
56325612
type-fest "^0.10.0"
56335613

5634-
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.2.0, graceful-fs@^4.2.2:
5614+
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.2.0:
56355615
version "4.2.4"
56365616
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
56375617
integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==
@@ -5641,6 +5621,11 @@ graceful-fs@^4.1.6:
56415621
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.1.tgz#1c1f0c364882c868f5bff6512146328336a11b1d"
56425622
integrity sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw==
56435623

5624+
graceful-fs@^4.2.2:
5625+
version "4.2.3"
5626+
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
5627+
integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
5628+
56445629
graphql@^14.4.2:
56455630
version "14.4.2"
56465631
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.4.2.tgz#553a7d546d524663eda49ed6df77577be3203ae3"
@@ -8087,7 +8072,7 @@ [email protected]:
80878072
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
80888073
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
80898074

8090-
ms@2.1.2, ms@^2.1.1:
8075+
ms@^2.1.1:
80918076
version "2.1.2"
80928077
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
80938078
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

0 commit comments

Comments
 (0)