Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions script/publish-storybook
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/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`
}, (error) => {
if(error) {
console.error('gh-pages failed to publish:', error.message.replace(process.env.GH_TOKEN, ''))
process.exitCode = 1
}
})
2 changes: 1 addition & 1 deletion script/release
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $(npm bin)/lerna exec -- $(pwd)/script/try-publish

# Build and publish storybook
$(npm bin)/build-storybook -o build
$(npm bin)/gh-pages -d build -b gh-pages --silent -r https://primer-css:${GH_TOKEN}@github.com/primer/storybook
script/publish-storybook

echo "📓 Updated CHANGELOG..."

Expand Down