-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
49 lines (43 loc) · 1.41 KB
/
.travis.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
# Travis CI for https://travis-ci.com/endiliey/endiliey.github.io/
language: node_js
node_js:
- '8'
branches:
only:
- source
cache:
yarn: true
notifications:
email: true
env:
matrix:
- TEST_TYPE=build_website
script:
- |
if [ "$TEST_TYPE" != build_website ];
then
yarn run $TEST_TYPE
else
if [ "$TRAVIS_PULL_REQUEST" = false ]; then
# Configure git user & setup
echo "Publishing ..."
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
cd website && yarn install && yarn run write-translations && cd ..
# install Crowdin
sudo apt-get install default-jre
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
# upload translation strings and download translations
cd website
CROWDIN_DOCUSAURUS_PROJECT_ID="${CROWDIN_ID}" CROWDIN_DOCUSAURUS_API_KEY="${CROWDIN_API}" yarn run crowdin-upload
CROWDIN_DOCUSAURUS_PROJECT_ID="${CROWDIN_ID}" CROWDIN_DOCUSAURUS_API_KEY="${CROWDIN_API}" yarn run crowdin-download
# publish
GIT_USER="${GH_NAME}" yarn run publish-gh-pages
else
# Make sure the website builds without error
echo "Builds .."
cd website && yarn install && yarn build
fi
fi