Deploy on GCP staging env run the strapi build for production enviroment

Thanks @Richard_Nsama for your answer.

I dosn’t have a NODE_ENV property in my .env file.

I set the NODE_ENV in my app.yaml google cloud env_variables like you see.

If i run yarn gcp-build (that runs strapi build) in my local machine, then it’s building ui for DEVELOPMENT enviroment. But when i deploy to GCP, it’s building for PRODUCTION enviroment as i show you in the images.

I fix the error in a very homemade way but i want to find a good solution… I change the package.json and set:

  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi",
    "gcp-build": "NODE_ENV=staging strapi build"
  },

But when i want to deploy to production enviroment i need to change the package.json file.

It’s really weird because when I deploy it runs strapi_build for the production environment, but when the application runs, it sets the staging environment.

I think that passing the NODE_ENV variable in my google cloud app.yaml does not change that before doing the deploy it has to do a build and I don’t know where to specify the enviroment correctly to do that build.

I don’t understand why in my local machine it does it for the DEVELOPMENT enviroment and when I deploy it does it for the PRODUCTION enviroment