This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
57 lines (55 loc) · 1.61 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
language: node_js
node_js:
- "10.4.0"
cache:
yarn: true
directories:
- node_modules
env:
global:
# These variables are for the "staging" branch.
- STAGING_API_ENDPOINT="https://api.hackillinois.org"
- STAGING_BASE_URL="https://test.hackillinois.org"
# These variables are for the "master" branch.
- MASTER_API_ENDPOINT="https://api.hackillinois.org"
- MASTER_BASE_URL="https://hackillinois.org"
# These variables are for all other branches.
- DEFAULT_API_ENDPOINT="https://api.hackillinois.org"
- DEFAULT_BASE_URL="https://hackillinois.org"
before_script:
- |
if [ "$TRAVIS_BRANCH" = "staging" ]; then
for prefixed_envvar in ${!STAGING_*}; do
eval export ${prefixed_envvar#STAGING_}="${!prefixed_envvar}"
done
elif [ "$TRAVIS_BRANCH" = "master" ]; then
for prefixed_envvar in ${!MASTER_*}; do
eval export ${prefixed_envvar#MASTER_}="${!prefixed_envvar}"
done
else
for prefixed_envvar in ${!DEFAULT_*}; do
eval export ${prefixed_envvar#DEFAULT_}="${!prefixed_envvar}"
done
fi
- npm install
script:
- yarn build
deploy:
- provider: s3
access_key_id: $HACKILLINOIS_ACCESS_KEY
secret_access_key: $HACKILLINOIS_SECRET_KEY
bucket: $HACKILLINOIS_BUCKET_NAME
skip_cleanup: true
local_dir: build
on:
branch: master
- provider: s3
access_key_id: $HACKILLINOIS_ACCESS_KEY
secret_access_key: $HACKILLINOIS_SECRET_KEY
bucket: $HACKILLINOIS_TEST_BUCKET_NAME
skip_cleanup: true
local_dir: build
on:
branch: staging
after_deploy:
- ./scripts/invalidate.sh