-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
47 lines (47 loc) · 1.37 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
sudo: false
language: node_js
node_js: 10
before_install:
- openssl aes-256-cbc -K $encrypted_f53d498de89d_key -iv $encrypted_f53d498de89d_iv
-in id_rsa_deploy.enc -out id_rsa_deploy -d
- chmod 600 id_rsa_deploy
install:
- npm install '@angular/cli' -g
- npm install -g travis-ci-cloudfront-invalidation
- npm install
- npm list || true
- gem install compass
script:
- npm config ls -l
- echo $TRAVIS_BRANCH
- node --version
- ng version
- SCRIPTS_FN=src/environments/environment.prod.ts
- sed "s/WENFO_GOOGLE_MAPS_API_KEY/$GOOGLE_MAPS_API_KEY/g" < $SCRIPTS_FN > tmp
- mv tmp $SCRIPTS_FN
- env BRANCH=$TRAVIS_BRANCH npm run build
- cat dist/index.html
deploy:
- skip_cleanup: true
provider: script
script: cd dist && scp -o StrictHostKeyChecking=no -i ../id_rsa_deploy -r . [email protected]:/home/$FTP_USER/public_html/ternanu/staging
on:
branch: master
- skip_cleanup: true
provider: s3
access_key_id: "$AWS_ACCESS_KEY_ID"
secret_access_key: "$AWS_SECRET_ACCESS_KEY"
region: "$AWS_DEFAULT_REGION"
bucket: "$AWS_S3_BUCKET"
local_dir: dist
on:
branch: production
after_deploy:
- travis-ci-cloudfront-invalidation -a $AWS_ACCESS_KEY_ID -s $AWS_SECRET_ACCESS_KEY
-c $CLOUDFRONT_DISTRIBUTION_ID -i "/*" -b $TRAVIS_BRANCH -p $TRAVIS_PULL_REQUEST
-o "production"
notifications:
email: false
slack:
rooms: wenfo:N1YfzQWaJ8wfjvrYarrh33PZ
on_success: always