Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Add github pages publishing script #143

Merged
merged 20 commits into from
Dec 11, 2018
Merged

Add github pages publishing script #143

merged 20 commits into from
Dec 11, 2018

Conversation

dr3
Copy link
Contributor

@dr3 dr3 commented Dec 7, 2018

Resolves #37

Adds a publishing npm package 'storybook-deployer' by storybooks which publishes storybook to the gh-pages branch and then to https://bbc-news.github.io/psammead

  • I have assigned myself to this PR and the corresponding issues
  • Tests added for new features
  • Test engineer approval

@dr3 dr3 added the alpha-2 label Dec 7, 2018
@dr3 dr3 self-assigned this Dec 7, 2018
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick work!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
ChrisBAshton and others added 4 commits December 7, 2018 12:58
ChrisBAshton
ChrisBAshton previously approved these changes Dec 7, 2018
radiocontrolled
radiocontrolled previously approved these changes Dec 7, 2018
Copy link
Contributor

@radiocontrolled radiocontrolled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sareh sareh dismissed stale reviews from radiocontrolled and ChrisBAshton via 4af8d74 December 7, 2018 17:13
package.json Outdated Show resolved Hide resolved
@sareh
Copy link
Contributor

sareh commented Dec 7, 2018

Trying this locally, I couldn't get the deployment to succeed.

npm run deploy-storybook

> @bbc/psammead@0.1.0 deploy-storybook /Users/heidas03/dev/psammead
> storybook-to-ghpages --source-branch ghstorybook --branch gh-pages

=> Getting the git remote URL
   executing: git config --get remote.origin.url
=> Building storybook for: @bbc/psammead
   executing: build-storybook  -o out2569
   executing: git init
   executing: git config user.name "GH Pages Bot"
   executing: git config user.email "hello@ghbot.com"
   executing: git config commit.gpgsign false
   executing: git add .
   executing: git commit -m "Deploy Storybook to GitHub Pages"
=> Deploying storybook
   executing: git push --force --quiet git@github.com:bbc-news/psammead.git ghstorybook:gh-pages
/Users/heidas03/dev/psammead/node_modules/@storybook/storybook-deployer/src/utils.js:14
  throw new Error(
  ^

Error: Exec code(1) on executing: git push --force --quiet git@github.com:bbc-news/psammead.git ghstorybook:gh-pages
undefined
    at Object.exec (/Users/heidas03/dev/psammead/node_modules/@storybook/storybook-deployer/src/utils.js:14:9)
    at Object.<anonymous> (/Users/heidas03/dev/psammead/node_modules/@storybook/storybook-deployer/bin/storybook_to_ghpages:69:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

@sareh sareh removed the mergeable label Dec 7, 2018
@dr3
Copy link
Contributor Author

dr3 commented Dec 10, 2018

Reasons for not using @storybooks/storybook-deployer

  • There are a number of issues that raise concerns about the package https://github.com/storybooks/storybook-deployer/issues
  • It had issues with publishing from latest branch
  • It creates a sub-repo on psammead when used, which is hard to delete locally
  • It uses a custom user, not the person doing the push
  • It wipes the gh-pages branch on each publish

bcmn
bcmn previously approved these changes Dec 10, 2018
@sareh
Copy link
Contributor

sareh commented Dec 10, 2018

When I ran npm run deploy-storybook locally, I saw this Slack notification, which was useful.
slack notification github storybook deployment

On the issue, there's a final point add instructions to Definition of Done so that we remember to do this when we merge things. It would be good to add this to the PR.

CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-Authored-By: dr3 <drew.mcmillan@bbc.co.uk>
Copy link
Contributor

@sareh sareh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks great!

@dr3 dr3 merged commit 9af5f93 into latest Dec 11, 2018
@dr3 dr3 deleted the ghstorybook branch December 11, 2018 10:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants