Skip to content

Commit 090b18e

Browse files
authored
fix(docs): upload clean URL aliases to TOS (#2055)
1 parent debf5f2 commit 090b18e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/docs-tos.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ jobs:
106106
--cache-control "${HTML_CACHE_CONTROL}" \
107107
--only-show-errors
108108
109+
while IFS= read -r -d '' html_file; do
110+
rel_path="${html_file#${DIST_DIR}/}"
111+
case "${rel_path}" in
112+
index.html|404.html) continue ;;
113+
esac
114+
115+
clean_path="${rel_path%.html}"
116+
aws s3 cp "${html_file}" "s3://${TOS_BUCKET}/${clean_path}" \
117+
--endpoint-url "https://${TOS_S3_ENDPOINT}" \
118+
--content-type "text/html; charset=utf-8" \
119+
--cache-control "${HTML_CACHE_CONTROL}" \
120+
--only-show-errors
121+
done < <(find "${DIST_DIR}" -type f -name "*.html" -print0)
122+
109123
aws s3 cp "${DIST_DIR}/assets" "s3://${TOS_BUCKET}/assets/" \
110124
--endpoint-url "https://${TOS_S3_ENDPOINT}" \
111125
--recursive \

0 commit comments

Comments
 (0)