forked from rust-lang/prev.rust-lang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (66 loc) · 2.58 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
68
69
70
71
72
language: ruby
rvm:
- 2.1
# Containers are cool!
sudo: false
install:
- bundle install
- pip install --user awscli
- ~/.local/bin/aws configure set preview.cloudfront true
# Build and deploy the site to the S3 bucket on push to master, unless PR
script: bundle exec jekyll build
branches:
only:
- master
deploy:
provider: s3
access_key_id: AKIAIDW6AYUZL5LIEXEQ
secret_access_key:
secure: "jlWAaG7awqiUpu650cH+/Yo4BT4naMO2YCTqgPUYq8P8AZFQ59GkuWLPR330lMg3om0y2WZLg95ksEsw7b91EYj20NMyaDhqCOrLoT1PwLePC2/3+CpVcxO0mX89CR9v11WFpMdd89sP3dc25jb/4ervDKP0s8iFoNcnrZmAQXQ="
bucket: www-rust-lang-org
acl: public_read
skip_cleanup: true
local_dir: _site
region: us-west-1
on:
branch: master
condition: $TRAVIS_PULL_REQUEST = "false"
# Cloudfront invalidation: If not PR, decrypt credentials, then build
# invalidation payload with `travis/inval-list.py` and use locally-installed
# awscli to submit it
after_success:
- '[[ $TRAVIS_PULL_REQUEST == "false" ]] && python travis/inval-list.py'
after_deploy:
- '[[ $TRAVIS_PULL_REQUEST == "false" ]] && ~/.local/bin/aws cloudfront create-invalidation
--invalidation-batch file://payload.json --distribution-id E25WPEM258W4SB'
# How the magic numbers work and where to put them:
#
# The AWS CLI that you get from pip is the tool likeliest to be up to date
# with the API. It uses some environment variables described in its docs:
# http://docs.aws.amazon.com/cli/latest/topic/config-vars.html
#
# We set them by going to the Travis UI at
# https://travis-ci.org/rust-lang/rust-www/settings and creating the variables
# AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY with the appropriate values.
#
# The values in those env vars come from the Travis account's IAM credentials,
# which you can get from
# https://console.aws.amazon.com/iam/home?region=us-west-1#users if you're
# logged in as someone with the appropriate permissions. The
# cloudfront distribution-id is listed in the ID field of the distribution for
# www-rust-lang-org on the console at
# https://console.aws.amazon.com/cloudfront/home?region=us-west-1.
#
# For the deploy step, the secret access key is encrypted on the command line.
# Encryption uses the Travis CLI, so on your laptop,
#
# $ gem install travis
#
# The string you encrypt for the SECRET_ACCESS_KEY will be the same as the
# string in the AWS_SECRET_ACCESS_KEY variable that you set earlier.
# To encrypt the single variable:
#
# $ travis encrypt -r rust-lang/rust-www "abc123"
#
# The output of that command will contain a `secure: "7890wxyzPQR"` line which
# you then add to `.travis.yml` under `secret_access_key`.