BA-1498: add action for storybook deploy #10
This file contains 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: Build and Publish Storybooks to GitHub Pages | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
deploy-components: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 | |
with: | |
install_command: yarn workspace @baseapp-frontend/components install --frozen-lockfile | |
build_command: yarn workspace @baseapp-frontend/components storybook:build | |
path: packages/components/storybook-static | |
checkout: false | |
target_branch: gh-pages | |
target_folder: storybook-components | |
- name: Upload Components Storybook Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: components-storybook-${{ github.run_id }} | |
path: packages/components/storybook-static | |
deploy-design-system: | |
runs-on: ubuntu-latest | |
needs: deploy-components | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 | |
with: | |
install_command: yarn workspace @baseapp-frontend/design-system install --frozen-lockfile | |
build_command: yarn workspace @baseapp-frontend/design-system storybook:build | |
path: packages/design-system/storybook-static | |
checkout: false | |
target_branch: gh-pages | |
target_folder: storybook-design-system | |
- name: Upload Design System Storybook Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: design-system-storybook-${{ github.run_id }} | |
path: packages/design-system/storybook-static |