Skip to content

Commit c510864

Browse files
committed
no dirs in stag/prod
1 parent 0a0bffe commit c510864

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

docs/deploy_mkdocs.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,17 @@ def deploy_docs(environment, branch=None, aws_profile=None, source_dir="site"):
5151
print("Make sure you've run 'make build' first.")
5252
sys.exit(1)
5353

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+
5665
cmd = [
5766
"aws", "s3", "sync",
5867
str(source_path) + "/",
@@ -67,15 +76,15 @@ def deploy_docs(environment, branch=None, aws_profile=None, source_dir="site"):
6776

6877
print(f"Deploying to {environment} environment:")
6978
print(f" Bucket: {bucket}")
70-
print(f" Branch: {branch}")
79+
if environment == "sandbox":
80+
print(f" Branch: {branch}")
7181
print(f" S3 Path: {s3_path}")
7282

7383
try:
7484
run_command(cmd)
7585
print(f"✅ Successfully deployed to {environment}!")
7686

7787
# Print the URL where it's deployed
78-
url = f"https://{bucket}/{branch}/"
7988
print(f"📍 Deployed to: {url}")
8089

8190
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)