Skip to content

Commit 286bef5

Browse files
committed
feat: Implement basic templating and circleci
1 parent c1a852e commit 286bef5

File tree

13 files changed

+4891
-74
lines changed

13 files changed

+4891
-74
lines changed

.circleci/config.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ node_modules/
6363

6464
# dotenv environment variables file
6565
.env
66+
67+
# Public output
68+
public/

404.html

-39
This file was deleted.
File renamed without changes.
File renamed without changes.

firebase.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"hosting": {
3-
"public": ".",
3+
"public": "./public",
44
"ignore": [
55
"firebase.json",
66
"**/.*",

0 commit comments

Comments
 (0)