Skip to content

Commit

Permalink
feat: remove preview deployment from Vercel (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
maneike authored Nov 4, 2024
1 parent 655d9b4 commit 213401f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
18 changes: 11 additions & 7 deletions packages/core/utils/vercel/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs/promises';
import { execSync } from 'node:child_process';
import { connectWithGH } from './connectWithGH';
import { getDeploymentUrl } from './utils/getDeploymentUrl';
import { getLogColor } from '../shared/getLogColor';

export const deployVercelProject = async () => {
Expand All @@ -20,12 +20,16 @@ export const deployVercelProject = async () => {
await fs.writeFile('vercel.json', JSON.stringify(vercelConfig, null, 2));

getLogColor('vercel', 'Creating production deployment...');
const productionUrl = getDeploymentUrl(true);

getLogColor('vercel', 'Creating preview deployment...');
const previewUrl = getDeploymentUrl(false);
const productionUrl = execSync('vercel --prod', {
stdio: ['inherit', 'pipe', 'inherit'],
encoding: 'utf8',
});

getLogColor('vercel', `You can access your preview deployment at: \x1b[36m${previewUrl}\x1b[0m`);

getLogColor('vercel', `You can access your production deployment at: \x1b[36m${productionUrl}\x1b[0m`);
if (productionUrl) {
getLogColor('vercel', `You can access your production deployment at: \x1b[36m${productionUrl}\x1b[0m`);
} else {
getLogColor('vercel', 'Failed to create production deployment.');
return;
}
};
22 changes: 0 additions & 22 deletions packages/core/utils/vercel/utils/getDeploymentUrl.ts

This file was deleted.

0 comments on commit 213401f

Please sign in to comment.