title: React Deployment to Firebase from Gitlab fails with error: to Specified public directory 'build' does not exist, can't deploy hosting to site
body: <p>This is the firebase.json file</p>
  <pre><code>{
    &quot;hosting&quot;: {
      &quot;public&quot;: &quot;build&quot;,
      &quot;ignore&quot;: [
        &quot;firebase.json&quot;,
        &quot;**/.*&quot;,
        &quot;**/node_modules/**&quot;
      ],
      &quot;rewrites&quot;: [
        {
          &quot;source&quot;: &quot;**&quot;,
          &quot;destination&quot;: &quot;/index.html&quot;
        }
      ]
    }
  }
  </code></pre>
  <p>This is my <code>.gitlab-ci.yml</code>:</p>
  <pre><code>image: tragopoulos/firebase:latest
  
  stages:
    - build
    - test
    - deploy
  
  cache:
    paths:
      - node_modules/
    key: &quot;$CI_BUILD_REPO&quot;
  
  build:
    stage: build
    image: node
    script:
      - echo &quot;# Start building App&quot;
      - npm install
      - npm build
      - echo &quot;# Build successfully!&quot;
    artifacts:
      expire_in: 1 hour
      paths:
        - &quot;/build&quot;
        - node_modules/
  
  test:
    stage: test
    image: node
    script:
      - echo &quot;# Testing App&quot;
      - npm install
      - CI=true npm test
      - echo &quot;# Test successfully!&quot;
  
  deploy-develop:
    stage: deploy
    environment: tragopoulos-portfolio-dev
    only:
      - develop
    before_script:
      - npm install
      - npm build
    script:
      - echo &quot;# Deploying App&quot;
      - firebase use tragopoulos-portfolio --token $FIREBASE_TOKEN
      - firebase deploy --only hosting -m &quot;Pipeline $CI_PIPELINE_ID Build $CI_BUILD_ID&quot;
      - echo &quot;# Deployed successfully!&quot;
  
  </code></pre>
  <p>and this is the error:</p>
  <p><a href="https://i.stack.imgur.com/EUgRP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EUgRP.png" alt="enter image description here" /></a></p>
  <p>I tried &quot;build&quot;, &quot;/build&quot;, &quot;/build/&quot;, &quot;/PROJECT_NAME/build&quot; nothing is working. I also don't know how to <code>$ echo</code> the build path so I can debug it in the project. In Angular the &quot;dist&quot; works without any issue. Any idea?</p>