Last active
July 11, 2024 23:48
-
-
Save vlaja/7a024b75c9412ad32eb40c6b5d2e04a3 to your computer and use it in GitHub Desktop.
Firebase multi-site deployment config for CircleCI
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.1 | |
executors: | |
node10: | |
docker: | |
- image: circleci/node:10 | |
working_directory: ~/project | |
commands: | |
build: | |
description: "Builds the project" | |
steps: | |
- checkout | |
- restore_cache: | |
keys: | |
# Find a yarn.lock cache | |
- v1-npm-deps-{{ checksum "yarn.lock" }} | |
# Fallback cache to be used | |
- v1-npm-deps- | |
- run: | |
name: Install Dependencies | |
command: yarn install | |
- save_cache: | |
key: v1-npm-deps-{{ checksum "yarn.lock" }} | |
paths: | |
- ./node_modules | |
- run: | |
name: Build for current environment. | |
command: yarn build | |
deploy: | |
description: "Deploy project to the designated environment" | |
parameters: | |
env: | |
type: string | |
default: "test" | |
steps: | |
- run: | |
name: Firebase Deploy | |
command: ./node_modules/.bin/firebase deploy --token "$FIREBASE_TOKEN" --non-interactive --only hosting:<< parameters.env >> | |
jobs: | |
build-deploy-test: | |
executor: node10 | |
steps: | |
- build | |
- deploy: | |
env: "test" | |
build-deploy-staging: | |
executor: node10 | |
steps: | |
- build | |
- deploy: | |
env: "staging" | |
build-deploy-production: | |
executor: node10 | |
steps: | |
- build | |
- deploy: | |
env: "production" | |
workflows: | |
version: 2 | |
test: | |
jobs: | |
- build-deploy-test: | |
filters: | |
branches: | |
only: develop | |
staging: | |
jobs: | |
- build-deploy-staging: | |
filters: | |
branches: | |
only: /release\/.*/ | |
production: | |
jobs: | |
- build-deploy-production: | |
filters: | |
branches: | |
only: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment