From ac82d7a91e7969d8bd8bd7af27e93e8f431bac5c Mon Sep 17 00:00:00 2001 From: yucccc Date: Tue, 1 Nov 2022 12:21:54 +0800 Subject: [PATCH] feat(temp-react): build docs --- .../.github/workflows/storybook.yml | 23 +++++++++++++++++++ .../.storybook/main.js | 7 +++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 template/react-component-library/.github/workflows/storybook.yml diff --git a/template/react-component-library/.github/workflows/storybook.yml b/template/react-component-library/.github/workflows/storybook.yml new file mode 100644 index 0000000..53236bd --- /dev/null +++ b/template/react-component-library/.github/workflows/storybook.yml @@ -0,0 +1,23 @@ +name: Storybook +on: + push: + branches: + - main # if any push happens on branch `main`, run this workflow. You could also add `paths` to detect changes in specific folder + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + + - name: Install and Build + run: | + npm ci + npm run build-storybook + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@3.6.2 + with: + branch: gh-pages + folder: storybook-static # npm run build-storybook输出的文件夹 \ No newline at end of file diff --git a/template/react-component-library/.storybook/main.js b/template/react-component-library/.storybook/main.js index e9c7678..5d0c2fb 100644 --- a/template/react-component-library/.storybook/main.js +++ b/template/react-component-library/.storybook/main.js @@ -14,5 +14,10 @@ module.exports = { }, "features": { "storyStoreV7": true - } + }, + async viteFinal(config) { + // base需要修改为你项目的目录路径 + config.base = '/react-component-library-template/' + return config + }, } \ No newline at end of file