diff --git a/deploy.sh b/deploy.sh index 5ffb8766f..2f3674566 100755 --- a/deploy.sh +++ b/deploy.sh @@ -46,13 +46,11 @@ for i in $EXAMPLES; do echo "building ${EXAMPLE_NAME}..." yarn + rm -rf dist .cache yarn build - gsutil mkdir -p gs://tfjs-examples/$EXAMPLE_NAME - gsutil mkdir -p gs://tfjs-examples/$EXAMPLE_NAME/dist - gsutil -m cp dist/* gs://tfjs-examples/$EXAMPLE_NAME/dist + # Remove the example directory. + gsutil -m rm -r gs://tfjs-examples/$EXAMPLE_NAME + # Gzip and copy all the dist files. The trailing slash is important. + gsutil -m cp -Z -r dist gs://tfjs-examples/$EXAMPLE_NAME/ cd .. done - -gsutil -m setmeta -h "Cache-Control:private" "gs://tfjs-examples/**.html" -gsutil -m setmeta -h "Cache-Control:private" "gs://tfjs-examples/**.css" -gsutil -m setmeta -h "Cache-Control:private" "gs://tfjs-examples/**.js"