Currently, I have an application running on NextJS deployed on GCP. As I set up Continuous Deployment (CD) for the application, I realized that there are three different deploy configurations - referred to as cd-one.yaml, cd-two.yaml, and cd-three.yaml. Each deployment configuration has a corresponding app.yml file - app-one.yml, app-two.yml, and app-three.yml.
An example of the code within an app.yml file:
https://i.sstatic.net/bUVp4.pngThe only varying elements in each app.yml file are the service and GCP_SERVICE values (e.g., one, two, and three). Fortunately, the CD setups are functioning correctly and deploying successfully. However, I encountered an issue when attempting to utilize these variables within my next.config.js file.
https://i.sstatic.net/0YvJX.pngBy referencing the variables from app.yml, everything works as intended, yielding the expected behavior. But when I tried to implement the same logic in my next.config.js file, it seems that the variables are not being passed through properly, causing it always to default to the final condition. Here's the snippet of my next.config.js file:
https://i.sstatic.net/7uVu0.pngDespite numerous attempts, I'm unable to resolve this issue. Are there any alternative methods to accomplish this task effectively?