Fuse/scripts/deploy-docs.sh
2020-12-30 13:03:33 -08:00

31 lines
550 B
Bash
Executable File

#!/usr/bin/env sh
# Purpose: build and publish the doumentation (https://fusejs.io)
# abort on errors
set -e
read -p "Do you want to publish the website? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
# build
npm run docs:build
# navigate into the build output directory
cd docs/.vuepress/dist
echo 'fusejs.io' > CNAME
git init
git add -A
git commit -m 'docs(site): publish site'
git push -f git@github.com:krisk/fuse.git master:gh-pages
echo "✅ Pushed to GitHub"
else
echo "\033[0;31mCancelling...\033[0m"
fi