@@ -8,34 +8,18 @@ import { paths } from "@oko-wallet-ci/paths";
88
99const VERCEL_SCOPE = "keplrwallet" ;
1010
11- const APP_CONFIGS = {
12- "oko-demo-web" : {
13- path : paths . demo_web ,
14- } ,
15- "oko-attached" : {
16- path : paths . oko_attached ,
17- } ,
18- "oko-customer-dashboard" : {
19- path : paths . ct_dashboard_web ,
20- } ,
21- "oko-docs-web" : {
22- path : path . join ( paths . root , "apps/docs_web" ) ,
23- } ,
24- "oko-admin-web" : {
25- path : paths . oko_admin_web ,
26- } ,
27- "oko-user-dashboard" : {
28- path : path . join ( paths . root , "apps/user_dashboard" ) ,
29- } ,
30- "oko-attached-mobile-host-web" : {
31- path : paths . attached_mobile_host_web ,
32- } ,
33- "oko-sandbox-evm" : {
34- path : path . join ( paths . root , "sandbox/sandbox_evm" ) ,
35- } ,
36- "oko-sandbox-sol" : {
37- path : path . join ( paths . root , "sandbox/sandbox_sol" ) ,
38- } ,
11+ type DeploymentEnv = "alpha" | "develop" | "prod" ;
12+
13+ const APP_CONFIGS : Record < string , { path : string } > = {
14+ "oko-demo-web" : { path : paths . demo_web } ,
15+ "oko-attached" : { path : paths . oko_attached } ,
16+ "oko-customer-dashboard" : { path : paths . ct_dashboard_web } ,
17+ "oko-docs-web" : { path : path . join ( paths . root , "apps/docs_web" ) } ,
18+ "oko-admin-web" : { path : paths . oko_admin_web } ,
19+ "oko-user-dashboard" : { path : path . join ( paths . root , "apps/user_dashboard" ) } ,
20+ "oko-attached-mobile-host-web" : { path : paths . attached_mobile_host_web } ,
21+ "oko-sandbox-evm" : { path : path . join ( paths . root , "sandbox/sandbox_evm" ) } ,
22+ "oko-sandbox-sol" : { path : path . join ( paths . root , "sandbox/sandbox_sol" ) } ,
3923} ;
4024
4125function listDeployableApps ( ) : void {
@@ -45,10 +29,8 @@ function listDeployableApps(): void {
4529 } ) ;
4630}
4731
48- type DeploymentEnv = "alpha" | "develop" | "prod" ;
49-
5032interface DeployOptions {
51- app ?: keyof typeof APP_CONFIGS ;
33+ app ?: string ;
5234 env ?: DeploymentEnv ;
5335}
5436
@@ -132,8 +114,27 @@ export async function deploy(options: DeployOptions) {
132114
133115 const deployRet = spawnSync ( "vercel" , deployArgs , {
134116 cwd : paths . root ,
135- stdio : "inherit" ,
117+ stdio : [ "inherit" , "pipe" , "inherit" ] ,
118+ encoding : "utf8" ,
136119 } ) ;
137120 expectSuccess ( deployRet , "Vercel deployment failed" ) ;
138- console . log ( chalk . bold . green ( "\n✓ Deployment completed successfully!" ) ) ;
121+ const deploymentUrl = deployRet . stdout . trim ( ) ;
122+ console . log ( chalk . green ( `✓ Deployed: ${ deploymentUrl } \n` ) ) ;
123+ console . log ( chalk . bold . green ( "✓ Deployment completed successfully!" ) ) ;
124+
125+ // Step 4: Alias (if VERCEL_ALIAS_DOMAIN env var is set)
126+ const aliasDomain = process . env . VERCEL_ALIAS_DOMAIN ;
127+ if ( aliasDomain ) {
128+ console . log ( chalk . blue ( "\nAliasing" ) , `${ deploymentUrl } → ${ aliasDomain } ` ) ;
129+ const aliasRet = spawnSync (
130+ "vercel" ,
131+ [ "alias" , "set" , deploymentUrl , aliasDomain , `--scope=${ VERCEL_SCOPE } ` ] ,
132+ {
133+ cwd : paths . root ,
134+ stdio : "inherit" ,
135+ } ,
136+ ) ;
137+ expectSuccess ( aliasRet , "Vercel alias failed" ) ;
138+ console . log ( chalk . bold . green ( `✓ Aliased to ${ aliasDomain } ` ) ) ;
139+ }
139140}
0 commit comments