storybook-eol / storybook-deployer

Deploy your storybook as a static site
MIT License
893 stars 71 forks source link

Works locally but I get an error on Travis #29

Open philipbeadle opened 6 years ago

philipbeadle commented 6 years ago

I'd love to have my storybook deploy auto but I keep hitting this 128 error

storybook-to-ghpages => Getting the git remote URL executing: git config --get remote.origin.url => Building storybook executing: npm run build-storybook -- -o out7256 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 https://github.com/Holochain/web-components.git master:gh-pages /home/travis/build/Holochain/web-components/node_modules/@storybook/storybook-deployer/src/utils.js:16 throw new Error(message); ^ Error: Exec code(128) on executing: git push --force --quiet https://github.com/Holochain/web-components.git master:gh-pages undefined at Object.exec (/home/travis/build/Holochain/web-components/node_modules/@storybook/storybook-deployer/src/utils.js:16:9) at Object. (/home/travis/build/Holochain/web-components/node_modules/@storybook/storybook-deployer/bin/storybook_to_ghpages:68:14) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) at Function.Module.runMain (module.js:676:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3

priley86 commented 6 years ago

Hello ;)

I actually did a presentation on this at All Things Open this year...

See the deployment section for step by step notes with Travis: http://bit.do/ato2017

I use a deployment key (as it’s more secure than personal access tokens), but you’ll want to securely enable your Travis build to push first.

There is also examples in our github project, patternfly/patternfly-react. Hope it helps!

jeremenichelli commented 6 years ago

I'm having the same issue, I don't know if the error itself comes from the package (it could be a setup error on Travis). I do feel the package should inform better what the error is, having an undefined at... is not informative enough and the developer experience around this obscure errors is super ugly.

I think the package should do some sanity checks before running exec before to give a better error handling.

In my case, it works locally but fails on Travis just as @philipbeadle describes it. Even when I have both personal tokens and deploy keys in the config, and the --ci does not solve this.

paschalidi commented 5 years ago

Hey 👋 what is the latest with this one ❔ Could you find a way to have this working?

indfnzo commented 5 years ago

Just ran into this issue, and I can confirm that the --ci flag fixes the build (assuming the build fails on the git push --force step). In my case, I had to double the argument-passing dashes since I was using lerna to execute the npm script:

lerna run --scope @my-project/storybook deploy-storybook -- -- --ci

I believe this happens since git is trying to display an interactive yes/no prompt on the container, which needs to be bypassed to run without intervention.

shadiabuhilal commented 4 years ago

Try to create babel config file inside .storybook directory, to allow babel to build your project correctly.

Note: you can require the root babel config using babel.config.js file.

For more info please check https://storybook.js.org/docs/configurations/custom-babel-config/#docs-content

yukipastelcat commented 4 years ago

I'm having same issue with GitHub actions, --ci flag doesn't help.

Got Exec code(128) on executing: git push --force --quiet, guess dedicated babel config has nothing to do with that, because build step passes just fine (I tried it actually, it didn't work).