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

Automatically use CI mode if CI env variable is present #94

Merged
merged 2 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ npm run deploy-storybook -- --monorepo-index-generator my-custom-generator.js

To deploy Storybook as part of a CI step, pass the `ci` flag to `npm run deploy-storybook`.

If the `CI` environment variable is set then this mode will be assumed, therefore no need to specify the `ci` flag.

Because pushing to GitHub as part of a CI step requires a [personal access token](https://github.com/blog/1509-personal-api-tokens), Storybook uses the `GH_TOKEN` environment variable, by default, to authenticate GitHub pushes.

This environment variable name can be configured via the `host-token-env-variable` flag.
Expand Down Expand Up @@ -238,6 +240,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
4 changes: 2 additions & 2 deletions src/parse-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module.exports = packageJson => {
PACKAGES_DIRECTORY: argv.packages,
MONOREPO_INDEX_GENERATOR: argv['monorepo-index-generator'],
NPM_SCRIPT: argv.script || 'build-storybook',
CI_DEPLOY: Boolean(argv.ci),
CI_DEPLOY: Boolean(argv.ci) || Boolean(process.env.CI),
DRY_RUN: Boolean(argv.dryRun),
// Git Variables
GIT_REMOTE: argv.remote || 'origin',
Expand All @@ -115,6 +115,6 @@ module.exports = packageJson => {
AWS_PROFILE: argv['aws-profile'] || 'default',
BUCKET_PATH: argv['bucket-path'],
S3_PATH: 's3://' + argv['bucket-path'],
S3_SYNC_OPTIONS: argv['s3-sync-options'],
S3_SYNC_OPTIONS: argv['s3-sync-options']
};
};