Last active
March 23, 2018 03:07
-
-
Save Mr-Perfection/2cb7558db9b32a6f4f7438ebca3b93fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
working_directory: ~/firebase-functions-hello-world | |
docker: | |
# specify the version you desire here | |
- image: circleci/node:7.10 | |
steps: | |
- checkout | |
- restore_cache: | |
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | |
- run: | |
name: Install npm dependencies inside functions... | |
command: npm install -prefix "functions" | |
- save_cache: | |
paths: | |
- ~/firebase-functions-hello-world | |
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | |
deploy-dev: | |
docker: | |
- image: circleci/node:7.10 | |
working_directory: ~/firebase-functions-hello-world | |
steps: | |
- run: | | |
echo Deploying to firebase... | |
firebase use --token ${FIREBASE_DEPLOY_TOKEN} ${PROJECT_ID} | |
firebase deploy --token ${FIREBASE_DEPLOY_TOKEN} | |
deploy-prod: | |
docker: | |
- image: circleci/node:7.10 | |
working_directory: ~/firebase-functions-hello-world | |
steps: | |
- run: | |
name: Install firebase-tools... | |
command: sudo npm install -g firebase-tools | |
- restore_cache: | |
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | |
- run: | | |
echo Deploying to firebase... | |
firebase use --token ${FIREBASE_DEPLOY_TOKEN} ${PROJECT_ID} | |
firebase deploy --token ${FIREBASE_DEPLOY_TOKEN} | |
workflows: | |
version: 2 | |
build-deploy: | |
jobs: | |
- build | |
- deploy-dev: | |
requires: | |
- build | |
filters: | |
branches: | |
only: /dev-.*/ | |
- deploy-prod: | |
requires: | |
- build | |
filters: | |
branches: | |
only: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment