Add Storybook GitHub workflow for publishing to GH pages (#51235)
* Add storybook workflow * Update version and add trigger for push on trunk * Add workflow_dispatch for manual trigger also * Add permissions * Add trigger for current branch * Set install to true for monorepo setup * Add write permissions * Use hashes for GH action versions and add --quiet for building storybook * Remove on push trigger for now
This commit is contained in:
parent
b72e07c605
commit
cf4f76ecfb
|
@ -0,0 +1,34 @@
|
|||
name: Storybook GitHub Pages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository == 'woocommerce/woocommerce' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: trunk
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Build Storybook
|
||||
run: pnpm --filter='@woocommerce/storybook' build-storybook --quiet
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./tools/storybook/storybook-static
|
||||
force_orphan: true
|
Loading…
Reference in New Issue