1
1
mirror of https://github.com/primer/css.git synced 2024-12-23 14:13:14 +03:00

storybook: build to .storybuild, run script/publish-storybook

This commit is contained in:
Shawn Allen 2019-03-06 11:46:16 -08:00
parent 90c7006611
commit d09713f60e
3 changed files with 7 additions and 27 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@
.changelog
.next/
.sass-cache
.storybuild/
_site
build/
dist/
node_modules/

View File

@ -34,11 +34,11 @@
"postpublish": "script/postpublish",
"prepare": "npm run dist",
"prepublishOnly": "script/prepublish",
"publish-storybook": "npm run storybook && gh-pages -d build -b gh-pages -r https://github.com/primer/storybook",
"publish-storybook": "script/publish-storybook",
"start": "next dev",
"dev": "next dev",
"start-storybook": "start-storybook -p 8001",
"build-storybook": "build-storybook -o build",
"build-storybook": "build-storybook -o .storybuild",
"sync": "script/sync",
"test": "npm-run-all -s test-urls test-migrate",
"test-all-modules": "ava --verbose tests/test-*.js",

View File

@ -1,24 +1,4 @@
#!/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
}
})
#!/bin/bash
remote=${STORYBOOK_GIT_URL:-https://github.com/primer/storybook}
npm run build-storybook
npx gh-pages -d .storybuild -b gh-pages -r "$remote" "$@"