Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 227aa53

Browse files
author
edunham
committed
Skip impossible steps when building pull requests
1 parent 45c75bb commit 227aa53

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.travis.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ language: ruby
22
rvm:
33
- 2.1
44

5-
# Cloudfront invalidation: Decrypt credentials, then run
5+
# Cloudfront invalidation: If not PR, decrypt credentials, then run
66
# https://github.com/laurilehmijoki/cf-s3-invalidator if build succeeded
77
before_install:
8-
- openssl aes-256-cbc -K $encrypted_13e2bd2b9e2d_key -iv $encrypted_13e2bd2b9e2d_iv -in _cf_s3_invalidator.yml.enc -out _cf_s3_invalidator.yml -d
9-
install: cf-s3-invalidator
10-
after_success: cf-s3-inv
8+
- [ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_13e2bd2b9e2d_key -iv $encrypted_13e2bd2b9e2d_iv -in _cf_s3_invalidator.yml.enc -out _cf_s3_invalidator.yml -d
9+
install:
10+
- [ "${TRAVIS_PULL_REQUEST}" = "false" ] && cf-s3-invalidator
11+
after_success:
12+
- [ "${TRAVIS_PULL_REQUEST}" = "false" ] && cf-s3-inv
1113

12-
# Build and deploy the site to the S3 bucket on push to master
14+
# Build and deploy the site to the S3 bucket on push to master, unless PR
1315
script: jekyll build
1416
branches:
1517
only:
@@ -27,3 +29,4 @@ deploy:
2729
on:
2830
repo: rust-lang/rust-www
2931
branch: master
32+
condition: "${TRAVIS_PULLREQUEST}" = "false"

0 commit comments

Comments
 (0)