From cf4f76ecfb3cdaaabaf7a6ae179f6685cb8d51a2 Mon Sep 17 00:00:00 2001 From: louwie17 Date: Tue, 10 Sep 2024 17:19:57 +0200 Subject: [PATCH] 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 --- .github/workflows/storybook-pages.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/storybook-pages.yml diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml new file mode 100644 index 00000000000..0e84b6df80f --- /dev/null +++ b/.github/workflows/storybook-pages.yml @@ -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