Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

[FE-2635] fix: fail build if assets upload fails (#43137)

Alaister Young8b81bcdb507c
diff --git a/scripts/upload-static-assets.sh b/scripts/upload-static-assets.sh
index f3bfc48a2bd..aa5aa2eef98 100755
--- a/scripts/upload-static-assets.sh
+++ b/scripts/upload-static-assets.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -eo pipefail
#######
@@ -82,13 +83,11 @@ aws s3 sync "$PUBLIC_DIR" "s3://$BUCKET_NAME/$SITE_NAME/${VERCEL_GIT_COMMIT_SHA:
--region auto \
--only-show-errors
-if [ $? -eq 0 ]; then
- echo -e "${GREEN}Upload completed successfully!${NC}"
-
- # Clean up local static files so we prevent a double upload
- echo -e "${YELLOW}Cleaning up local static files...${NC}"
- rm -rf "$STATIC_DIR"/*
- echo -e "${GREEN}Local static files cleaned up${NC}"
+echo -e "${GREEN}Upload completed successfully!${NC}"
- # We still keep the public dir, as Next.js does not officially support serving the public files via CDN
-fi
\ No newline at end of file
+# Clean up local static files so we prevent a double upload
+echo -e "${YELLOW}Cleaning up local static files...${NC}"
+rm -rf "$STATIC_DIR"/*
+echo -e "${GREEN}Local static files cleaned up${NC}"
+
+# We still keep the public dir, as Next.js does not officially support serving the public files via CDN
\ No newline at end of file