|
1 |
| -name: Deploy Main Storybook |
| 1 | +name: Build and Deploy Storybook |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches:
|
6 | 6 | - main
|
7 |
| - workflow_dispatch: |
| 7 | + workflow_call: |
| 8 | + secrets: |
| 9 | + PUBLISH_STORYBOOK_TOKEN: |
| 10 | + required: true |
8 | 11 |
|
9 | 12 | jobs:
|
10 |
| - build-and-deploy: |
11 |
| - name: Build and Deploy Main Storybook |
12 |
| - runs-on: ubuntu-latest |
| 13 | + build-deploy-storybook: |
| 14 | + name: Build and Deploy Storybook |
13 | 15 | permissions:
|
14 | 16 | contents: write
|
| 17 | + runs-on: ubuntu-latest |
15 | 18 | environment: github-pages
|
16 | 19 | defaults:
|
17 | 20 | run:
|
18 | 21 | working-directory: apps/storybook-react
|
19 | 22 | steps:
|
20 |
| - - name: Checkout and setup high risk environment |
| 23 | + - name: Checkout and setup environment |
21 | 24 | uses: MetaMask/action-checkout-and-setup@v1
|
22 | 25 | with:
|
23 |
| - is-high-risk-environment: true |
24 |
| - skip-allow-scripts: true |
| 26 | + is-high-risk-environment: false |
| 27 | + cache-node-modules: true |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: yarn --immutable |
25 | 31 |
|
26 |
| - - name: Build storybook |
| 32 | + - name: Build Storybook |
27 | 33 | run: yarn build-storybook
|
28 | 34 |
|
29 | 35 | - name: Deploy to GitHub Pages
|
30 | 36 | uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935
|
31 | 37 | with:
|
32 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
33 |
| - publish_dir: apps/storybook-react/storybook-static |
34 |
| - destination_dir: storybook |
| 38 | + personal_token: ${{ secrets.PUBLISH_STORYBOOK_TOKEN }} |
| 39 | + publish_dir: ./storybook-static |
| 40 | + destination_dir: storybook-static |
0 commit comments