Overwrite vercel build command as set in the project settings #11299
Replies: 1 comment
|
I achieved this by adding a step in the Github action to add an env variable via the vercel CLI:
TURBO_FORCE is a built in Turborepo env variable used for forcing a build. One the build is complete the env var can be removed via the command line. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Question
I am using Github Actions to build and deploy my next.js application to Vercel. I am also using Turborepo.
My next.js application has an associated headless Sanity CMS. When content is updated in the CMS a webhook will trigger a production build of the next.js application.
I am using the following Vercel CLI calls within my Github Action:
Within my Vercel project I have set the build step as follows:
cd ../../.. && npx turbo run build --filter={apps/project/web}...The problem I have is that when a deployment is triggered via a content change in the CMS, the turbo remote cache is being used and the project is not being rebuilt to reflect the new content - this is as you would expect, because there have been no code changes.
I need a way to somehow override the above command so that I can add the
—forceoption that is available with Turborepo. Like so:cd ../../.. && npx turbo run build --force --filter={apps/project/web}...I cannot see an option for
vercel buildto allow me to do this. Is there a way to achieve this?All reactions