forked from googleapis/google-cloud-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (47 loc) · 1.54 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
language: node_js
node_js:
- 0.12
- 4
- 6
- 7
os:
- linux
- osx
before_install:
- npm install -g npm # Force using the latest npm to get dedupe during install
install:
- npm install --ignore-scripts
before_script:
- npm run lint
- if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
export IS_PUSH_TO_MASTER=true;
fi
- if [ $IS_PUSH_TO_MASTER ]; then
openssl aes-256-cbc -K $encrypted_b8aa0887832a_key -iv $encrypted_b8aa0887832a_iv -in key.json.enc -out key.json -d;
export GCLOUD_TESTS_KEY="$(pwd)/key.json";
fi
script: "node ./scripts/build.js"
after_success:
# We check to see if the job number ends with 1 (e.g. 234234.1)
# letting us know it is the first pass for this build
- if [ $IS_PUSH_TO_MASTER && "${TRAVIS_JOB_NUMBER}" == *1 ]; then
rm -rf docs/json;
npm run docs;
git submodule add -q -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} ghpages;
cp -rf docs/json/* ghpages/json;
cp docs/manifest.json ghpages;
cd ghpages;
set +e;
git add .;
set -e;
if [[ -z "$(git status --porcelain)" ]]; then
echo "Nothing to commit. Exiting without pushing changes.";
exit 0;
fi;
git config user.name "travis-ci";
git config user.email "travis@travis-ci.org";
git commit -m "Update docs for ${TRAVIS_TAG:-master} [ci skip]";
git status;
git push -q https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages;
fi
sudo: false