mirror of https://gitlab.com/curben/blog
build: deploy microblog to mirrors
This commit is contained in:
parent
e6c9bc5597
commit
3d45602df9
|
@ -8,3 +8,5 @@ public/
|
|||
.deploy*/
|
||||
bun.lockb
|
||||
.wrangler/
|
||||
site/
|
||||
microblog/
|
||||
|
|
16
build.sh
16
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
|
||||
|
|
Loading…
Reference in New Issue