Try to maintain history

This commit is contained in:
Nemo 2020-04-27 11:18:07 +05:30
parent f2ac77c5e3
commit 5c50074c74
1 changed files with 8 additions and 7 deletions

15
ci.sh
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
BRANCH="gh-pages"
# Run the scan # Run the scan
cd website cd website
@ -9,13 +9,14 @@ bundle install
bundle show bundle show
bundle exec jekyll build --verbose --destination _site bundle exec jekyll build --verbose --destination _site
if ([ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ]); then git clone "$GIT_REMOTE" --branch "$BRANCH" /tmp/remote_site
cd _site
git init if ([ $TRAVIS_BRANCH == "keep-history" ] && [ $TRAVIS_PULL_REQUEST == "false" ]); then
git remote add origin "$GIT_REMOTE" cp -r _site/* /tmp/remote_site
cd /tmp/remote_site
git add . git add .
git commit -m "Deploy to GitHub Pages" git commit -m "Update: `date`"
git push --force --quiet origin master:gh-pages > /dev/null 2>&1 git push --force --quiet origin > /dev/null 2>&1
echo 'Build successful, deployed to gh-pages.' echo 'Build successful, deployed to gh-pages.'
else else
echo "Build successful, but not deploying!" echo "Build successful, but not deploying!"