Search code examples
reactjsgoogle-app-engine

How do I ensure that using `gcloud app deploy` is using my build folder not my dev files?


I am new to google app engine. I have a react app

Before deploying to production I use npm run build which creates / updated the build folder. Then I push my app to app engine using gcloud app deploy.

How do I know that the server is using the files in my build folder?

Is there something I should specify in my app.yaml?

Thank you!


Solution

  • You could create an NPM script to first change into the desired build directory when deploying the App Engine app.

    package.json

    "scripts": {
      "app.deploy": "cd dist/app/ && gcloud app deploy app.yaml --project api-project-########## --version v2 --no-promote --verbosity debug"
       ...
    }
    

    Run the script:

    npm run app.deploy