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:
parent
90c7006611
commit
d09713f60e
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,7 +4,7 @@
|
||||
.changelog
|
||||
.next/
|
||||
.sass-cache
|
||||
.storybuild/
|
||||
_site
|
||||
build/
|
||||
dist/
|
||||
node_modules/
|
||||
|
@ -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",
|
||||
|
@ -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" "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user