This repository has been archived by the owner on Dec 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.travis.yml
68 lines (58 loc) · 1.83 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
hbranches:
only:
- develop
- master
language: go
sudo: false
go: 1.7
cache:
directories:
- /node_modules
before_install:
- . $HOME/.nvm/nvm.sh
- nvm install v8.12.0
- nvm use v8.12.0
install:
- npm install -g gulp
- curl -sSL https://github.com/gohugoio/hugo/releases/download/v0.52/hugo_0.52_Linux-64bit.tar.gz | tar -zxf - -C /tmp/
- export PATH="/tmp:$PATH"
- npm install
script:
- if [ "$TRAVIS_BRANCH" == "vamp-ee" ]; then gulp build:staging && gulp hugo:vamp-ee-staging; fi
- if [ "$TRAVIS_BRANCH" == "develop" ]; then gulp build:staging && gulp hugo:staging; fi
- if [ "$TRAVIS_BRANCH" == "master" ]; then gulp build:prod && gulp hugo:prod; fi
# Set correct robots.txt and CNAME files
before_deploy: |
if [ $TRAVIS_BRANCH == "master" ]; then
cp ./CNAME ./public/CNAME && cp ./robots.prod.txt ./public/robots.txt
else
cp ./robots.dev.txt ./public/robots.txt
fi
# Deploy master to Github
deploy:
- provider: pages
local_dir: public
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
on:
branch: master
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: staging.vamp.io
region: eu-central-1
local_dir: public
skip_cleanup: true
on:
branch: develop
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: vamp-ee-staging.vamp.io
region: eu-central-1
local_dir: public
skip_cleanup: true
on:
branch: vamp-ee
after_deploy:
- if [ "$TRAVIS_BRANCH" == "master" ]; then curl -X DELETE "https://api.cloudflare.com/client/v4/zones/d398c5b6e2d191e2d6865081facab63b/purge_cache" -H "X-Auth-Email:$CLOUDFLARE_USER" -H "X-Auth-Key:$CLOUDFLARE_KEY" -H "Content-Type:application/json" --data '{"purge_everything":true}'; fi