@@ -51,8 +51,17 @@ def deploy_docs(environment, branch=None, aws_profile=None, source_dir="site"):
51
51
print ("Make sure you've run 'make build' first." )
52
52
sys .exit (1 )
53
53
54
- # Build S3 sync command
55
- s3_path = f"s3://{ bucket } /{ branch } /"
54
+ # Build S3 sync command - use branch for sandbox, root for staging/production
55
+ if environment == "sandbox" :
56
+ s3_path = f"s3://{ bucket } /{ branch } /"
57
+ url = f"http://sandbox.docs.s3-website.us-east-2.amazonaws.com/{ branch } /"
58
+ else :
59
+ s3_path = f"s3://{ bucket } /"
60
+ if environment == "staging" :
61
+ url = f"https://staging.docs.opentrons.com/"
62
+ else : # production
63
+ url = f"https://docs.opentrons.com/"
64
+
56
65
cmd = [
57
66
"aws" , "s3" , "sync" ,
58
67
str (source_path ) + "/" ,
@@ -67,15 +76,15 @@ def deploy_docs(environment, branch=None, aws_profile=None, source_dir="site"):
67
76
68
77
print (f"Deploying to { environment } environment:" )
69
78
print (f" Bucket: { bucket } " )
70
- print (f" Branch: { branch } " )
79
+ if environment == "sandbox" :
80
+ print (f" Branch: { branch } " )
71
81
print (f" S3 Path: { s3_path } " )
72
82
73
83
try :
74
84
run_command (cmd )
75
85
print (f"✅ Successfully deployed to { environment } !" )
76
86
77
87
# Print the URL where it's deployed
78
- url = f"https://{ bucket } /{ branch } /"
79
88
print (f"📍 Deployed to: { url } " )
80
89
81
90
except subprocess .CalledProcessError as e :
0 commit comments