This repository has been archived by the owner on Aug 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
67 lines (59 loc) · 1.7 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
58
59
60
61
62
63
64
65
66
67
language: node_js
node_js: "10"
cache: npm
dist: bionic
branches:
only:
- develop
- master
- /^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]+$/
env:
global:
- PATH=$HOME/.local/bin:$PATH # for `aws`
install:
- npm ci
- pip install --user awscli
script:
- npm run build
- zip -r build-$TRAVIS_TAG.zip build
- echo "Bundle SHA-256 checksum $(sha256sum build-$TRAVIS_TAG.zip)"
before_deploy: pip install --user awscli
deploy:
- provider: script
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: $S3_BUCKET
skip_cleanup: true
region: us-east-2
local_dir: build
acl: public_read
script: ~/.local/bin/aws s3 sync build s3://$S3_BUCKET --region us-east-2 --delete
on:
branch: develop
# Note CloudFront is not configured for max-age to be honored.
cache_control: "max-age=$CACHE_MAX_AGE"
- provider: script
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: $S3_BUCKET
skip_cleanup: true
region: us-east-2
local_dir: build
acl: public_read
script: ~/.local/bin/aws s3 sync build s3://$S3_BUCKET --region us-east-2 --delete
on:
branch: master
# Note CloudFront is not configured for max-age to be honored.
cache_control: "max-age=$CACHE_MAX_AGE"
- provider: releases
api_key: $GH_TOKEN
file: build-$TRAVIS_TAG.zip
skip_cleanup: true
draft: true
name: $TRAVIS_TAG
on:
condition: $TRAVIS_TAG =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]+$
after_deploy:
- pip install --user awscli
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"