-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathreleaseDocs.sh
34 lines (26 loc) · 846 Bytes
/
releaseDocs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
set -e
export VSINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
export VisualStudioVersion="16.0"
docfx ./docs/docfx.json
SOURCE_DIR=$PWD
TEMP_REPO_DIR=$PWD/../my-project-gh-pages
echo "Removing temporary doc directory $TEMP_REPO_DIR"
rm -rf $TEMP_REPO_DIR
mkdir $TEMP_REPO_DIR
echo "Cloning the repo with the gh-pages branch"
git clone https://github.com/markvincze/Stubbery --branch gh-pages $TEMP_REPO_DIR
echo "Clear repo directory"
cd $TEMP_REPO_DIR
git rm -r *
echo "Copy documentation into the repo"
cp -r $SOURCE_DIR/docs/_site/* .
if [ "$APPVEYOR_REPO_BRANCH" == "main" ]
then
echo "Push the new docs to the remote branch"
git add . -A
git commit --allow-empty -m "Update generated documentation"
git push origin gh-pages
else
echo "Not on main, skipping pushing docs"
fi