-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
39 lines (39 loc) · 1.33 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
jobs:
include:
- language: node_js
node_js:
- "11.10.1"
before_install:
- cd server
install:
- npm install
- stage: deploy
if: branch = beta AND type = push
language: node_js
node_js:
- "11.10.1"
before_script:
- echo "Adding the commit id"
- echo -e "$TRAVIS_COMMIT" > ./server/COMMIT
- cat ./server/COMMIT
- git add ./server/COMMIT
- git commit -m "[Travis] Added COMMIT"
- echo "Building the server"
- cd website
- npm i
- BASE_URL=https://sdp-10-beta.herokuapp.com npm run generate
- cd ..
- cp -r ./website/dist ./server/public
- git add ./server/public
- git commit -m "[Travis] Built website"
- echo "Setting up heroku deployment on local repo."
- echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "$travis_ssh_private_key" > ~/.ssh/id_rsa.heroku
- echo -e "$travis_ssh_public_key" > ~/.ssh/id_rsa.heroku.pub
- chmod 600 ~/.ssh/id_rsa.heroku
- eval `ssh-agent -s`
- ssh-add ~/.ssh/id_rsa.heroku
- git remote add heroku git@heroku.com:sdp-10-beta.git
script:
- echo "Deploying to heroku"
- git push heroku `git subtree split --prefix server`:master --force