add deploy script

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-03-11 16:34:54 +01:00
parent 09affb3d32
commit 27a92cab10
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 7997 additions and 0 deletions

35
bin/deploy.js Executable file
View File

@ -0,0 +1,35 @@
const { promisify } = require('util')
const { publish } = require('gh-pages')
const ghpublish = promisify(publish)
/* fix for "Unhandled promise rejections" */
process.on('unhandledRejection', err => { throw err })
const distDir = 'docs/.vuepress/dist'
const branch = 'gh-pages'
const org = 'status-im'
const repo = 'status-libs-site'
/* use SSH auth by default */
var repoUrl = `git@github.com:${org}/${repo}.git`
/* alternative auth using GitHub user and API token */
if (process.env.GH_TOKEN != undefined) {
repoUrl = (
'https://' + process.env.GH_USER +
':' + process.env.GH_TOKEN +
'@' + `github.com/${org}/${repo}.git`
)
}
const main = async (url, branch)=> {
console.log(`Pushing to: ${url}`)
console.log(`On branch: ${branch}`)
await ghpublish(distDir, {
repo: url,
branch: branch,
dotfiles: true,
silent: false
})
}
main(repoUrl, branch)

View File

@ -6,6 +6,7 @@
"author": "Jakub Sokołowski <jakub@status.im>",
"license": "MIT",
"devDependencies": {
"gh-pages": "^2.2.0",
"request": "^2.88.2",
"rimraf": "^3.0.2",
"vuepress": "^1.3.1"
@ -13,6 +14,7 @@
"scripts": {
"dev": "vuepress dev docs",
"build": "vuepress build docs",
"deploy": "node bin/deploy.js",
"clean": "git clean -fxd docs"
}
}

7960
yarn.lock Normal file

File diff suppressed because it is too large Load Diff