Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions deploy_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@
# 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
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