forked from PyThaiNLP/pythainlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.docs.yml
83 lines (68 loc) · 2.49 KB
/
appveyor.docs.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
82
83
# Configuration for deploy mode, commit message with /(build and deloy docs)/
# 1. Build documents and upload HTML files to AppVeyor's storage
# 2. Upload to thainlp.org/pythainlp/docs/<branch>
#---------------------------------#
# general configuration #
#---------------------------------#
branches:
only:
- /2.*/
- dev
only_commits:
message: /(build and deploy docs)/
#---------------------------------#
# environment configuration #
#---------------------------------#
image: ubuntu1804
# fetch repository as zip archive
# https://www.appveyor.com/docs/how-to/repository-shallow-clone/
shallow_clone: true
matrix:
fast_finish: true
cache:
- '~/.cache/pip'
- '~/nltk_data'
# - '~/pythainlp-data'
install:
- sudo apt-get update
- sudo apt-get install -y pandoc libicu-dev python3-pip
- python -V
- python3 -V
- pip -V
- pip3 -V
- export LD_LIBRARY_PATH=/usr/local/lib
- sudo pip3 install -r requirements.txt
- sudo pip3 install torch==1.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- sudo pip3 install --upgrade emoji epitran gensim numpy pandas pyicu sklearn-crfsuite ssg
- sudo pip3 install --upgrade attacut
- sudo pip3 install --upgrade "tensorflow>=1.14,<2" deepcut
- sudo pip3 install --upgrade boto smart_open sphinx sphinx-rtd-theme
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- cd ./docs
- export CURRENT_BRANCH=$APPVEYOR_REPO_BRANCH
- export RELEASE=$(git describe --tags --always)
- export RELEASE=$(echo $RELEASE | cut -d'-' -f1)
- export TODAY=$(date +'%Y-%m-%d')
- make html
- echo "Done building HTML files for the branch '$CURRENT_BRANCH'"
- echo "Start cleaning the directory '/docs/$CURRENT_BRANCH'"
- sudo bash ./clean_directory.sh $FTP_USER $FTP_PASSWORD $FTP_HOST $CURRENT_BRANCH
- echo "Start uploading files from './build/html'"
- echo "to 'thainlp.org/pythainlp/docs/$CURRENT_BRANCH'"
- cd ./_build/html
- find . -type f -name "*" -print -exec curl --ftp-create-dir --ipv4 -T {} ftp://${FTP_USER}:${FTP_PASSWORD}@${FTP_HOST}/public_html/pythainlp/docs/$CURRENT_BRANCH/{} \;
- echo "Done uploading."
- echo "Files uploaded to 'thainlp.org/pythainlp/docs/$CURRENT_BRANCH'"
artifacts:
- path: ./docs/_build/html
name: document
after_build:
- echo "Done build and deploy."
- appveyor exit
#---------------------------------#
# tests configuration #
#---------------------------------#
test: off