forked from paketo-buildpacks/paketo-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.js
25 lines (20 loc) · 788 Bytes
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
firebase = require('firebase-tools');
module.exports = async ({ expires } = { expires: '1h'}) => {
const { GITHUB_HEAD_REF } = process.env;
const branch = GITHUB_HEAD_REF.split('/')
.filter(item => item.trim().length > 0)
.pop();
firebase
.hosting
.channel
.deploy(branch, { json: true, expires, only: 'paketo-stage'})
.then((data) => {
console.log(`PR DEPLOYED TO: ${data['paketo-stage'].url}`)
console.log(`SITE EXPIRES AT: ${data['paketo-stage'].expireTime} (in ${expires})`)
console.log(`::set-output name=staging_url::${data['paketo-stage'].url}`)
console.log(`::set-output name=expiration::${data['paketo-stage'].expireTime} (in ${expires})`)
})
.catch((err) => {
console.log(`deploy: ${err}`);
});
}