I'm trying to figure out how to deploy to Firebase Hosting using CircleCI. As far as I know, there is no way to setup deployment with an SSH key, so I'm trying to find a way of logging into Firebase during deployment and push the code. What I have tried so far is the following in my circle.yml:
// circle.yml
deployment:
  production:
    branch: circle-deploy
    commands:
      - npm install -g firebase-tools
      - firebase login | echo -e "${FIREBASE_EMAIL}\n${FIREBASE_PASSWORD}"
      - firebase deploy
However, I keep getting the following error and I'm not sure how to remedy it.
stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: write EPIPE
    at errnoException (net.js:904:11)
at Object.afterWrite (net.js:720:19)
                CircleCI can deploy to virtually any target, and can be easily configured to integrate with other services for QA/testing, feature management, and deployment strategies such as blue-green or canary deployment.
More videos on YouTubeFirebase Hosting is production-grade web content hosting for developers. With a single command, you can quickly deploy web apps and serve both static and dynamic content to a global CDN (content delivery network).
A small addition to the other answers above...
In order to avoid installing firebase-tools globally in circle ci on every build:
Modify your package.json file to include firebase-tools as a dev dependency like so:
npm install --save-dev firebase-tools
Then in your circle.yml file:
deployment:
  production:
    branch: master
    commands:
      - ./node_modules/.bin/firebase deploy --token=$FIREBASE_TOKEN --non-interactive
                        I just had to do this and there is a easier way
On your machine, you can get your access token by typing
firebase login:ci
$FIREBASE_TOKEN
For your deploy step, you can skip the login:
deployment:
  production:
    branch: master
    commands:
      - firebase deploy --token=$FIREBASE_TOKEN --non-interactive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With