Open dominik-stypula-polcode opened 3 years ago
yarn run v1.21.1 $ yarn --cwd packages/storybook storybook-to-ghpages --source-branch=custom-branch $ /home/project/node_modules/.bin/storybook-to-ghpages --source-branch=custom-branch => Getting the git remote URL executing: git config --get remote.origin.url => Building storybook for: @conversionxl/storybook executing: build-storybook -o out1797 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:dominik-stypula-polcode/aybolit.git custom-branch:gh-pages /home/project/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:dominik-stypula-polcode/aybolit.git custom-branch:gh-pages error: src refspec custom-branch does not match any error: failed to push some refs to 'git@github.com:dominik-stypula-polcode/aybolit.git' at Object.exec (/home/project/node_modules/@storybook/storybook-deployer/src/utils.js:14:9) at Object.<anonymous> (/home/project/node_modules/@storybook/storybook-deployer/bin/storybook_to_ghpages:69:14) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make a following script in package.json, and run it
package.json
"deploy-test": "yarn --cwd packages/storybook storybook-to-ghpages --source-branch=custom-branch"
The script should deploy local custom-branch code to remote gh-pages branch.
custom-branch
gh-pages
In bin script storybook-to-ghpages before the following code:
storybook-to-ghpages
publishUtils.exec('git add .'); publishUtils.exec(`git commit -m ${JSON.stringify(config.commitMessage)}`);
add following code which does the checkout to the SOURCE_BRANCH if argument exists:
checkout
if(args.SOURCE_BRANCH) { publishUtils.exec(`git checkout -b ${JSON.stringify(args.SOURCE_BRANCH)}`); console.log(`=> Deploying from source branch: ${JSON.stringify(args.SOURCE_BRANCH)}`); }
anyone here?
bump
Describe the bug
Steps to reproduce the behavior
make a following script in
package.json
, and run itExpected behavior
The script should deploy local
custom-branch
code to remotegh-pages
branch.Fix proposal
In bin script
storybook-to-ghpages
before the following code:add following code which does the
checkout
to the SOURCE_BRANCH if argument exists: