-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
81 lines (62 loc) · 2.41 KB
/
.appveyor.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
stack: python 3.9
branches:
only:
- master
image:
- Ubuntu2004
environment:
GITHUB_API_KEY:
secure: w1zaTUARBAuhkAKUke5sBvSkVtlDGL8YfQxROzv5oGIynVJImn+KWGFVDxyjQore
install:
- cd $APPVEYOR_BUILD_FOLDER
# Configure CI bot git email/username
- git config --global user.name "AppVeyor CI Bot"
- git config --global user.email "[email protected]"
# Install the Twitter bot library dependencies
- python -m pip install --upgrade pip
- python -m pip install pillow
- python -m pip install tweepy
# Get the project submodule
- git submodule update --init --recursive
- git submodule update --remote --merge
# Push the latest versions of the submodules to the repository
- |
if [[ `git status --porcelain` ]]; then
git checkout master
git add geometrize-twitter-bot
git commit --message "Build bot updating submodule"
git remote rm origin
git remote add origin https://${GITHUB_API_KEY}@github.com/Tw1ddle/geometrize-twitter-bot-docs.git > /dev/null 2>&1
git push origin master
fi
# Build the documentation
build_script:
- cd $APPVEYOR_BUILD_FOLDER
- pushd doxygen
- doxygen doxygen_config
- popd
# Deploy the documentation to the GitHub pages branch
deploy_script:
# Important: this goes one level above the original build folder to avoid accidentally trashing the master branch
# Then clones the gh-pages repo, resets the history, copies the newly-generated docs and pushes back to gh-pages
- cd $APPVEYOR_BUILD_FOLDER
- cd ..
- mkdir gh-pages
# Get the gh-pages branch as a separate repo
- git clone -b gh-pages "https://${GITHUB_API_KEY}@github.com/Tw1ddle/geometrize-twitter-bot-docs.git" gh-pages
- pushd gh-pages
# Reset the gh-pages branch to nothing, discarding history and all
- treeHash=$(git hash-object -t tree /dev/null)
- firstCommitHash=$(git commit-tree -m "Empty commit" "$treeHash")
- git reset --hard "$firstCommitHash"
# Move the newly-generated docs to the gh-pages folder
- cd $APPVEYOR_BUILD_FOLDER/docs
- (shopt -s dotglob && mv * ../../gh-pages)
- cd ../../gh-pages
# Specify the domain the docs will be hosted on
- touch CNAME
- echo "botdocs.geometrize.co.uk" > CNAME
# Note that when there is nothing to commit, git commit exits with 1 (but that should never happen here)
- git add -A
- git commit -m "Build bot updating documentation"
- git push -f origin gh-pages