Skip to content

Commit 5d8f615

Browse files
authored
Merge pull request code-corps#304 from code-corps/fix-doc-deploy
Fix deploy docs
2 parents 1eda6f4 + 918907f commit 5d8f615

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

deploy_docs.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,31 @@
33
# Ensure exit codes other than 0 fail the build
44
set -e
55

6+
echo "Removing old local ./doc dir..."
7+
rm -rf ./doc
8+
69
# Pulling from GitHub
710
echo "Pulling from GitHub..."
811
mkdir -p doc
912
cd doc
1013
git init
1114
if ! git remote | grep origin; then
1215
git remote add origin [email protected]:code-corps/code-corps-api-github-pages.git
13-
git pull
16+
git fetch
17+
git checkout gh-pages
1418
fi
1519
cd ..
1620

1721
# Generate docs
1822
echo "Generating docs..."
1923
mix docs
20-
cd doc
2124

2225
# Push to GitHub
2326
echo "Pushing to GitHub..."
27+
cd doc
2428
git add .
2529
git commit -m "Update docs"
26-
git push -u origin master:gh-pages
30+
git push -u origin gh-pages:gh-pages --force
2731

2832
# Exit successfully
2933
exit 0

0 commit comments

Comments
 (0)