mirror of
https://github.com/primer/css.git
synced 2024-12-11 11:16:04 +03:00
24 lines
575 B
JavaScript
Executable File
24 lines
575 B
JavaScript
Executable File
#!/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
|
|
}
|
|
|
|
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'
|
|
}
|
|
}, (error) => {
|
|
if(error) {
|
|
console.error('gh-pages failed to publish:', error.message.replace(process.env.GH_TOKEN, ''))
|
|
process.exitCode = 1
|
|
}
|
|
})
|