Closed yafimvo closed 5 months ago
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
Any update? trying to do the same and few folks are reaching out to ME!
cc: @Milan-Shah @chrisbonifacio
Ummmm, oops have not realized have opened a duplicate copy/paste issue sorry u guys !!!!
Ummmm, oops have not realized have opened a duplicate copy/paste issue sorry u guys !!!!
@kvramyasri7
Thanks for bumping it up! I'm still waiting for a better solution since the CI/CD is quite a mess.
Maybe a quick solution would be allowing to update specific env params.
this way I can write a small github action script that runs whenever I want to deploy NextJS to Amplify (I can do it now but I need to share all of my Amplify secrets).
Something like this:
aws amplify update-app --app-id <my-app-id> \
--platform WEB_COMPUTE
--region <my-region>
--update-environment-variables AMPLIFY_MONOREPO_APP_ROOT=nextjs
push to my main nextjs branch branch, i.e., main_nextjs_branch
, to invoke the build on Amplify
After a successful build - return the platform to WEB
aws amplify update-app --app-id <my-app-id> \
--platform WEB
--region <my-region>
--update-environment-variables AMPLIFY_MONOREPO_APP_ROOT=react
Note I tried to create a conditional variable but it doesn't work for AMPLIFY_MONOREPO_APP_ROOT
so fixing this might be also useful.
Going to close this issue as it seems to be resolved. Please re-open if you still need help or check out our Amplify Discord!
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
This issue has been automatically locked.
Before opening, please confirm:
Amplify Hosting feature
Monorepo, SSR
Is your feature request related to a problem? Please describe:
I have a monorepo with two applications: one in React and another in Next.js. Each project has its own amplify.yml in its root folder. While I was able to build both applications in my Amplify, the CI/CD doesn't work properly because the app's platform should be 'Web' for React and 'Web compute' for Next.js. As a result, I need to manually change it every time I want to deploy one of them.
Also, a follow up question - is it possible to set the AMPLIFY_MONOREPO_APP_ROOT from one of the configuration files?
Describe how you'd like this feature to work
Generally, my goal is to connect both monorepo folders (react and nextjs) into 1 URL, i.e.
https://example.com
which is hosted on Amplify. Then, for everyexample.com/app2
, this should show the Next.js app; otherwise, it should show the React app. I was able to achieve this with a rewrite, however, I wonder if there is a simpler way to do it that will also support CI/CD.