-
-
Save 10go/bafaf2ad7783c1e343de326091b0b933 to your computer and use it in GitHub Desktop.
Sample gitlab CI file for deploying a `create-react-app` application to firebase.
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
image: node:6.11.3 | |
cache: | |
key: cache_yarn | |
paths: | |
- .cache_yarn | |
stages: | |
- install | |
- build | |
- test | |
- deploy | |
install_functions: | |
stage: install | |
script: | |
- cd ./functions && yarn install --cache-folder ../.cache_yarn | |
only: | |
- staging | |
- production | |
artifacts: | |
paths: | |
- functions/node_modules | |
install_client: | |
stage: install | |
script: | |
- cd ./client && yarn install --cache-folder ../.cache_yarn | |
only: | |
- staging | |
- production | |
artifacts: | |
paths: | |
- client/node_modules | |
build_client: | |
stage: build | |
script: | |
- cd ./client && yarn build | |
only: | |
- staging | |
- production | |
dependencies: | |
- install_client | |
artifacts: | |
paths: | |
- client/build | |
test_client: | |
stage: test | |
script: | |
- cd ./client && yarn test | |
only: | |
- staging | |
- production | |
dependencies: | |
- install_client | |
deploy_all_staging: | |
stage: deploy | |
script: | |
- yarn global add firebase-tools --cache-folder ../.cache_yarn | |
- firebase --token $FIREBASE_DEPLOY_KEY_STAGING --project staging deploy | |
only: | |
- staging | |
environment: | |
name: staging | |
dependencies: | |
- install_functions | |
- build_client | |
deploy_all_production: | |
stage: deploy | |
script: | |
- yarn global add firebase-tools --cache-folder ../.cache_yarn | |
- firebase --token $FIREBASE_DEPLOY_KEY_PRODUCTION --project production deploy | |
only: | |
- production | |
environment: | |
name: production | |
dependencies: | |
- install_functions | |
- build_client |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment