Storybook Workflow #432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Storybook Workflow | |
| on: | |
| workflow_run: | |
| workflows: [New release version] | |
| types: [completed] | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| # BUILD STORYBOOK AND DEPLOY TO GITHUB PAGES | |
| build-deploy: | |
| name: Build and deploy storybook | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: actions/checkout@v4 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: | | |
| yarn cache clean | |
| yarn install --immutable | |
| - name: Build Storybook | |
| run: yarn build-storybook | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./storybook |