diff options
author | Sam Potts <me@sampotts.me> | 2018-01-09 20:43:58 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2018-01-09 20:43:58 +1100 |
commit | 2e5d06ad8529f99c607e3f2e4c678f07e6973274 (patch) | |
tree | b70d55ec7ed28a5a65e7f2d6664e74734a982860 /gulpfile.js | |
parent | bacd049eb07e3de9e47f4c04516a1f517507ad97 (diff) | |
download | plyr-2e5d06ad8529f99c607e3f2e4c678f07e6973274.tar.lz plyr-2e5d06ad8529f99c607e3f2e4c678f07e6973274.tar.xz plyr-2e5d06ad8529f99c607e3f2e4c678f07e6973274.zip |
Publish script tweaks
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gulpfile.js b/gulpfile.js index 6bb28ad1..8dc3cf57 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -321,14 +321,27 @@ if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) { // Replace local file paths with remote paths in demo HTML // e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js" + const index = `${paths.demo.root}index.html`; + const error = `${paths.demo.root}error.html`; + const pages = [index]; + + if (branch.current === branch.master) { + pages.push(error); + } + gulp - .src([`${paths.demo.root}*.html`]) + .src(pages) .pipe(replace(localPath, versionPath)) .pipe(s3(aws.demo, options.demo)); + // Only update CDN for master (prod) + if (branch.current !== branch.master) { + return null; + } + // Upload error.html to cdn (as well as demo site) return gulp - .src([`${paths.demo.root}error.html`]) + .src([error]) .pipe(replace(localPath, versionPath)) .pipe(s3(aws.cdn, options.demo)); }); |