Fix beta deployment

This commit is contained in:
Sam Potts 2020-01-30 14:57:14 +00:00
parent 818e1efd43
commit 8b9521d5a5

View File

@ -294,7 +294,7 @@ const options = {
}, },
}, },
demo: { demo: {
uploadPath: branch.current === branch.beta ? 'beta' : null, uploadPath: branch.current === branch.beta ? '/beta' : null,
headers: { headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0', 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0',
}, },
@ -461,6 +461,14 @@ gulp.task('demo', done => {
return gulp return gulp
.src(pages) .src(pages)
.pipe(replace(localPath, versionPath)) .pipe(replace(localPath, versionPath))
.pipe(
rename(p => {
if (options.demo.uploadPath) {
// eslint-disable-next-line no-param-reassign
p.dirname += options.demo.uploadPath;
}
}),
)
.pipe(publisher.publish(options.demo.headers)) .pipe(publisher.publish(options.demo.headers))
.pipe(publish.reporter()); .pipe(publish.reporter());
}); });