This commit is contained in:
Sam Potts 2019-01-29 21:36:47 +11:00
parent b798368ba6
commit d9daf2c618

View File

@ -246,7 +246,7 @@ if (Object.keys(credentials).includes('aws') && Object.keys(credentials).include
const branch = { const branch = {
current: gitbranch.sync(), current: gitbranch.sync(),
master: 'master', master: 'master',
develop: 'develop', beta: 'beta',
}; };
const maxAge = 31536000; // 1 year const maxAge = 31536000; // 1 year
@ -258,7 +258,7 @@ if (Object.keys(credentials).includes('aws') && Object.keys(credentials).include
}, },
}, },
demo: { demo: {
uploadPath: branch.current === branch.develop ? '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',
Vary: 'Accept-Encoding', Vary: 'Accept-Encoding',
@ -289,7 +289,7 @@ if (Object.keys(credentials).includes('aws') && Object.keys(credentials).include
// Check we're on the correct branch to deploy // Check we're on the correct branch to deploy
const canDeploy = () => { const canDeploy = () => {
const allowed = [branch.master, branch.develop]; const allowed = [branch.master, branch.beta];
if (!allowed.includes(branch.current)) { if (!allowed.includes(branch.current)) {
console.error(`Must be on ${allowed.join(', ')} to publish! (current: ${branch.current})`); console.error(`Must be on ${allowed.join(', ')} to publish! (current: ${branch.current})`);