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

Adds `set -eo pipefail` so any failed upload immediately exits the
script with a non-zero code, failing the Vercel build.
This commit is contained in:
Alaister Young authored and GitHub committed 2026-02-24 20:53:14 +08:00
1 parent d810b7772b
commit 8b81bcdb50
1 file changed
+8 -9
+8 -9
View File
@@ -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
# 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