diff --git a/packages/core/installMachine/index.ts b/packages/core/installMachine/index.ts index 468a352..cfcbb1b 100644 --- a/packages/core/installMachine/index.ts +++ b/packages/core/installMachine/index.ts @@ -425,7 +425,7 @@ const createInstallMachine = (initialContext: InstallMachineContext) => { deployVercelProjectActor: createStepMachine( fromPromise(async ({ input }) => { try { - await deployVercelProject(); + await deployVercelProject(input.stateData.options.usePayload); input.stateData.stepsCompleted.deployVercelProject = true; saveStateToRcFile(input.stateData, input.projectDir); } catch (error) { diff --git a/packages/core/installMachine/installSteps/vercel/deploy.ts b/packages/core/installMachine/installSteps/vercel/deploy.ts index 60ae1db..34d70c7 100644 --- a/packages/core/installMachine/installSteps/vercel/deploy.ts +++ b/packages/core/installMachine/installSteps/vercel/deploy.ts @@ -1,7 +1,7 @@ import { execSync } from 'node:child_process'; import { logWithColoredPrefix } from '../../../utils/logWithColoredPrefix'; -export const deployVercelProject = async () => { +export const deployVercelProject = async (usePayload: boolean) => { execSync('npx vercel git connect', { stdio: ['inherit', 'pipe', 'inherit'], encoding: 'utf-8', @@ -13,11 +13,13 @@ export const deployVercelProject = async () => { encoding: 'utf8', }); - logWithColoredPrefix('vercel', 'Setting up environment variables...'); - execSync("grep PAYLOAD_SECRET apps/web/.env | cut -d '=' -f2 | vercel env add PAYLOAD_SECRET production", { - stdio: 'inherit', - encoding: 'utf8', - }); + if (usePayload) { + logWithColoredPrefix('vercel', 'Setting up environment variables...'); + execSync("grep PAYLOAD_SECRET apps/web/.env | cut -d '=' -f2 | vercel env add PAYLOAD_SECRET production", { + stdio: 'inherit', + encoding: 'utf8', + }); + } if (productionUrl) { logWithColoredPrefix('vercel', `You can access your production deployment at: \x1b[36m${productionUrl}\x1b[0m`);