@@ -20,6 +20,7 @@ const isBackend = args.has("--be");
2020const isDryRun = args . has ( "--dry" ) ;
2121const noSyncCheck = args . has ( "--no-sync-check" ) ;
2222const hotfix = args . has ( "--hotfix" ) ;
23+ const previewFe = args . has ( "--preview-fe" ) ;
2324
2425const PROJECT_ROOT = path . resolve ( __dirname , "../../../" ) ;
2526
@@ -252,6 +253,35 @@ const createGithubRelease = async (version, changelogContent) => {
252253} ;
253254
254255const main = async ( ) => {
256+ if ( previewFe ) {
257+ console . log ( `Starting frontend preview deployment process...` ) ;
258+ checkUncommittedChanges ( ) ;
259+ installDependencies ( ) ;
260+ runProjectRootCommand (
261+ "NODE_ENV=production npx turbo lint test check-assets build --filter @monkeytype/frontend --force" ,
262+ ) ;
263+
264+ const name = readlineSync . question (
265+ "Enter preview channel name (default: preview): " ,
266+ ) ;
267+ const channelName = name . trim ( ) || "preview" ;
268+
269+ const expirationTime = readlineSync . question (
270+ "Enter expiration time (e.g., 2h, default: 1d): " ,
271+ ) ;
272+ const expires = expirationTime . trim ( ) || "1d" ;
273+
274+ console . log (
275+ `Deploying frontend preview to channel "${ channelName } " with expiration "${ expires } "...` ,
276+ ) ;
277+ const result = runProjectRootCommand (
278+ `cd frontend && npx firebase hosting:channel:deploy ${ channelName } -P live --expires ${ expires } ` ,
279+ ) ;
280+ console . log ( result ) ;
281+ console . log ( "Frontend preview deployed successfully." ) ;
282+ process . exit ( 0 ) ;
283+ }
284+
255285 console . log ( `Starting ${ hotfix ? "hotfix" : "release" } process...` ) ;
256286
257287 if ( ! hotfix ) checkBranchSync ( ) ;
0 commit comments