diff --git a/.gitignore b/.gitignore index 84d1a50..acbe28a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ public/ .deploy*/ bun.lockb .wrangler/ +site/ +microblog/ diff --git a/build.sh b/build.sh index 4712e2b..c70e0cf 100644 --- a/build.sh +++ b/build.sh @@ -11,9 +11,23 @@ export PATH="$PATH:./node_modules/.bin" hexo generate -# deploy site assets if [ "$NODE_ENV" = "production" ] && [ -d "public/" ]; then + # deploy site assets git clone --depth 1 --branch site https://gitlab.com/curben/blog.git site cp -r site/* "public/" rm -f "public/README.md" + + # deploy microblog + git clone --depth 1 --branch microblog https://gitlab.com/curben/blog.git microblog + cd "microblog/" + export PATH="$PATH:../node_modules/.bin" + hexo generate + + cat "rsync-include.txt" | while read include; do + find "public/" -path "public/$include" -type f | while read file; do + destdir="../public/$(dirname $file | sed -r 's|^public/?||')" + mkdir -p "$destdir" + cp "$file" "$destdir" + done + done fi