From ef4b79ab75f73b8ba7e33e8c4dbbcba71c3ccd46 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 16 Apr 2022 13:28:27 +0530 Subject: [PATCH] fix: commit only when website has been updated --- scripts/ci.sh | 3 ++- scripts/zola.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ci.sh b/scripts/ci.sh index a2b6877..995459a 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -56,7 +56,8 @@ set_ssh_remote() { repository_owner=$(echo $http_remote_url | cut -d '/' -f 4) repository_name=$(echo $http_remote_url | cut -d '/' -f 5) ssh_remote="git@$remote_hostname:$repository_owner/$repository_name" - git remote add $SSH_REMOTE_NAME $ssh_remote || true + ssh_remote="git@gitea.hostea.org:Hostea/website.git" + git remote add $SSH_REMOTE_NAME $ssh_remote } clean() { diff --git a/scripts/zola.sh b/scripts/zola.sh index e036eeb..d69ace0 100755 --- a/scripts/zola.sh +++ b/scripts/zola.sh @@ -112,7 +112,7 @@ deploy() { /bin/rm -rf * cp -r $tmp_dir/* . git add --all - if [ -n $(git status --porcelain) ]; + if [ $(git status --porcelain | xargs | sed '/^$/d' | wc -l) -gt 0 ]; then echo "[*] Repository has changed, committing changes" git commit \