Hi there!
I’m trying to set up a workflow for my React project. What I want to achieve is to get a job to build the stuff and another one to deploy the master branch to Firebase hosting.
This is what I have so far after several configurations:
version: 2
jobs:
build:
docker:
- image: circleci/node:7.10
working_directory: /tmp/myproject
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run:
name: Build app in production mode
command: |
yarn build
deploy:
docker:
- image: circleci/node:7.10
working_directory: /tmp/myproject
steps:
- run:
name: Deploy Master to Firebase
command: ./node_modules/.bin/firebase deploy --token=MYTOKEN
workflows:
version: 2
build-and-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
The build job always success, but with the deploy I have this error:
#!/bin/bash -eo pipefail
./node_modules/.bin/firebase deploy --token=MYTOKEN
/bin/bash: ./node_modules/.bin/firebase: No such file or directory
Exited with code 1
So, what I understand is that the deploy job is not running in the same place the build was, right?
I’m not sure how to fix that. I’ve read some examples and tried several things, but it doesn’t work. I’ve also read the documentation but I think it’s not very clear how to configure everything… maybe I’m too dumb.
I hope you guys can help me out on this one.
Cheers!!