diff --git a/deploy_docs.sh b/deploy_docs.sh index ea6fad79a..0a0a39f1b 100755 --- a/deploy_docs.sh +++ b/deploy_docs.sh @@ -3,6 +3,9 @@ # Ensure exit codes other than 0 fail the build set -e +echo "Removing old local ./doc dir..." +rm -rf ./doc + # Pulling from GitHub echo "Pulling from GitHub..." mkdir -p doc @@ -10,20 +13,21 @@ cd doc git init if ! git remote | grep origin; then git remote add origin git@github.com:code-corps/code-corps-api-github-pages.git - git pull + git fetch + git checkout gh-pages fi cd .. # Generate docs echo "Generating docs..." mix docs -cd doc # Push to GitHub echo "Pushing to GitHub..." +cd doc git add . git commit -m "Update docs" -git push -u origin master:gh-pages +git push -u origin gh-pages:gh-pages --force # Exit successfully exit 0