forked from GSA/code-gov-front-end
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.js
More file actions
33 lines (25 loc) · 726 Bytes
/
deploy.js
File metadata and controls
33 lines (25 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const ghpages = require('gh-pages');
const path = require('path');
console.log("starting publish.js");
const DIR = process.env.CODE_GOV_DIR || path.join(__dirname, process.env.CODE_GOV_RELATIVE_DIR)
if (!DIR) {
throw new Error("please specify CODE_GOV_DIR as an env variable")
}
const options = {
dotfiles: false,
repo: process.env.CODE_GOV_REPO || 'git@github.com:GSA/code-gov-front-end'
}
console.log("options:", options)
if (process.env.CODE_GOV_BRANCH) {
options.branch = process.env.CODE_GOV_BRANCH
} else {
throw new Error("no branch specified")
}
ghpages.clean()
ghpages.publish(DIR, options, err => {
if (err) {
console.error(err);
} else {
console.log("published successfully");
}
});