From 9f1e0fccf9f97be49950231a00f465d20342d965 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Thu, 6 Aug 2020 17:40:36 -0700 Subject: [PATCH 1/2] feat: automatically use CI mode if CI environment variable is set Proposed here: https://github.com/storybookjs/storybook-deployer/issues/77#issuecomment-670051715 --- src/parse-args.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse-args.js b/src/parse-args.js index 8d307d2..e56104a 100644 --- a/src/parse-args.js +++ b/src/parse-args.js @@ -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', @@ -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'] }; }; From ba036f4e4d51efc9397ade940926c06dd8daf0ce Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Thu, 6 Aug 2020 17:50:41 -0700 Subject: [PATCH 2/2] docs: add documentation that the `CI` mode can be inferred from the `CI` variable being present --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e8c8e6d..4778509 100644 --- a/README.md +++ b/README.md @@ -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. @@ -238,6 +240,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d + This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!