-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
41 lines (35 loc) · 1.48 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
language: php
php:
- 7.1
cache:
yarn: true
before_install:
- openssl aes-256-cbc -K $encrypted_b7d425d3bc0a_key -iv $encrypted_b7d425d3bc0a_iv -in id_rsa.enc -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host $STAGING_SERVER\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "Host $PRODUCTION_SERVER\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2
- export PATH="$HOME/.yarn/bin:$PATH"
script:
- echo "hello world"
deploy:
- provider: script
skip_cleanup: true
script:
ssh -p $PORT $USER@$STAGING_SERVER 'cd /var/www/admin && git pull' &&
ssh -p $PORT $USER@$STAGING_SERVER 'cd /var/www/admin && composer install' &&
ssh -p $PORT $USER@$STAGING_SERVER 'cd /var/www/admin && yarn' &&
ssh -p $PORT $USER@$STAGING_SERVER 'cd /var/www/admin && npm run build' &&
ssh -p $PORT $USER@$STAGING_SERVER 'cd /var/www/admin && npm run publish'
on:
branch: master
- provider: script
skip_cleanup: true
script:
ssh -p $PORT $USER@$PRODUCTION_SERVER 'cd /var/www/admin && git pull' &&
ssh -p $PORT $USER@$PRODUCTION_SERVER 'cd /var/www/admin && composer install' &&
ssh -p $PORT $USER@$PRODUCTION_SERVER 'cd /var/www/admin && yarn' &&
ssh -p $PORT $USER@$PRODUCTION_SERVER 'cd /var/www/admin && npm run build' &&
ssh -p $PORT $USER@$PRODUCTION_SERVER 'cd /var/www/admin && npm run publish'
on:
branch: deploy