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

24 lines
575 B
Plaintext
Raw Normal View History

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