-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
54 lines (54 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
48
49
50
51
52
53
54
sudo: required
dist: trusty
language: node_js
branches:
only:
- master
node_js:
- "7"
python:
- "3.4"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# nodejs >v4 compiler requirements
- g++-4.8
- openjdk-7-jdk
env:
CXX=g++-4.8
before_install:
- sudo apt-get -y install python3-pip python-dev
- sudo pip3 install -U setuptools
- sudo pip3 install -U virtualenvwrapper
- python3 -V
- pip3 -V
install:
- sudo pip3 install awscli
- npm install
script:
- npm run lint
- npm run build
deploy:
- provider: s3
# You can refer to environment variables from Travis repo settings!
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
# Name of the S3 bucket to which your site should be uploaded.
bucket: www.theunissen.tech
# Prevent Travis from deleting your built site so it can be uploaded.
skip_cleanup: true
# Path to a directory containing your built site.
local_dir: public
# Set the Cache-Control header.
cache_control: "max-age=21600"
region: ap-southeast-2
after_deploy:
# Sync to other bucket
- aws s3 sync public s3://blog.theunissen.tech --region ap-southeast-2 --delete
# Allow `awscli` to make requests to CloudFront.
- aws configure set preview.cloudfront true
# Invalidate every object in the targeted distribution.
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_1 --paths "/*"
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_2 --paths "/*"