mirror of
https://github.com/primer/css.git
synced 2024-11-23 11:27:26 +03:00
25 lines
640 B
JavaScript
Executable File
25 lines
640 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const ghpages = require('gh-pages')
|
|
const {GITHUB_ACTOR, GITHUB_TOKEN} = process.env
|
|
|
|
if (GITHUB_TOKEN) {
|
|
console.error('Publish storybook: No GITHUB_TOKEN found for storybook publishing.')
|
|
process.exitCode = 1
|
|
return
|
|
}
|
|
|
|
ghpages.publish('build', {
|
|
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]'))
|
|
process.exitCode = 1
|
|
}
|
|
})
|