Search code examples
firebaseexpofirebase-hostingcircleci

Firebase Hosting and Expo Web: How to deploy Expo web build to Firebase hosting


I am currently attempting to deploy my Expo application to Firebase hosting, however my build uses the default index.html given by Firebase and my Expo's web-build/index.html is sitting and not being used. Is there a way to use my expo web build instead of Firebase's index.html? Please help and give me some insight :)

CircleCI config

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:10.17.0
    working_directory: ~/repo
    steps:
      - checkout
      # Download and cache dependencies
      - restore_cache:
          keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
      - run:
          name: Install Dependencies
          command: yarn
      - save_cache:
          key: v1-npm-deps-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run:
          name: Install Expo
          command: yarn global add expo-cli
      - run:
          name: Login into Expo
          command: npx expo-cli login -u <EXPO USERNAME> -p <EXPO PASSWORD>
      - run:
          name: Build
          command: expo build:web --non-interactive --no-pwa
      - run:
          name: Firebase Deploy
          command: ./node_modules/.bin/firebase deploy --token <FIREBASE TOKEN> --only hosting

Solution

  • I setup Firebase incorrectly, when running firebase init, I did not update my default path for the index.html.

    Followed the Expo deployment documentation