1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 01:04:04 +03:00
css/script/publish-storybook

25 lines
640 B
Plaintext
Raw Normal View History

2018-07-03 20:14:07 +03:00
#!/usr/bin/env node
const ghpages = require('gh-pages')
const {GITHUB_ACTOR, GITHUB_TOKEN} = process.env
2018-07-03 20:14:07 +03:00
if (GITHUB_TOKEN) {
console.error('Publish storybook: No GITHUB_TOKEN found for storybook publishing.')
process.exitCode = 1
return
}
ghpages.publish('build', {
2018-07-03 20:14:07 +03:00
branch: 'gh-pages',
repo: `https://${GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/primer/storybook.git`,
user: {
name: 'Primer CSS',
email: 'design-systems@github.com'
}
}, error => {
if (error) {
console.error('gh-pages failed to publish:', error.message.replace(process.env.GITHUB_TOKEN, '[secret]'))
2018-07-03 20:22:36 +03:00
process.exitCode = 1
2018-07-03 20:14:07 +03:00
}
})