[U] Update deploy script
This commit is contained in:
-14
@@ -1,14 +0,0 @@
|
|||||||
# Build
|
|
||||||
yarn run build
|
|
||||||
|
|
||||||
# Navigate into the build output directory
|
|
||||||
cd dist
|
|
||||||
|
|
||||||
# Deploying to a custom domain
|
|
||||||
echo 'profile.hydev.org' > CNAME
|
|
||||||
|
|
||||||
git init
|
|
||||||
git add -A
|
|
||||||
git commit -m 'deploy'
|
|
||||||
git push -f https://github.com/hykilpikonna/home-page.git master:gh-pages
|
|
||||||
cd ..
|
|
||||||
@@ -6,14 +6,20 @@ set -e
|
|||||||
# Build
|
# Build
|
||||||
yarn run build
|
yarn run build
|
||||||
|
|
||||||
# Navigate into the build output directory
|
DEPL="/etc/nginx/hres/aza.moe"
|
||||||
cd dist
|
|
||||||
|
|
||||||
# Deploying to a custom domain
|
# Update static files (since mv is way faster than cp, we use a tmp folder)
|
||||||
echo 'profile.hydev.org' > CNAME
|
if [ -d "$DEPL.tmp1" ]; then
|
||||||
|
sudo rm -rf "$DEPL.tmp1"
|
||||||
|
fi
|
||||||
|
cp -r dist "$DEPL.tmp1"
|
||||||
|
if [ -d "$DEPL" ]; then
|
||||||
|
sudo mv "$DEPL" "$DEPL.del"
|
||||||
|
fi
|
||||||
|
sudo mv "$DEPL.tmp1" "$DEPL"
|
||||||
|
if [ -d "$DEPL.del" ]; then
|
||||||
|
sudo rm -rf "$DEPL.del"
|
||||||
|
fi
|
||||||
|
|
||||||
git init
|
# Reload nginx
|
||||||
git add -A
|
sudo nginx -t && sudo systemctl restart nginx
|
||||||
git commit -m 'deploy'
|
|
||||||
git push -f git@github.com:hykilpikonna/home-page.git master:gh-pages
|
|
||||||
cd -
|
|
||||||
|
|||||||
Reference in New Issue
Block a user