From 8e5ee4804b999c8503212554d1ae419f4de06cf2 Mon Sep 17 00:00:00 2001 From: Ruslan Farkhutdinov Date: Fri, 30 Jan 2026 15:16:26 +0200 Subject: [PATCH 1/6] Storybook: Add manual deployment workflow --- .../workflows/pr-storybook-deploy-manual.yml | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/pr-storybook-deploy-manual.yml diff --git a/.github/workflows/pr-storybook-deploy-manual.yml b/.github/workflows/pr-storybook-deploy-manual.yml new file mode 100644 index 000000000000..86e97cd3ef21 --- /dev/null +++ b/.github/workflows/pr-storybook-deploy-manual.yml @@ -0,0 +1,94 @@ +name: Storybook PR Preview (manual) + +on: + workflow_dispatch: + inputs: + pr_number: + description: "Pull Request number" + required: true + type: string + action: + description: "What to do with the preview" + required: true + type: choice + options: + - deploy + - remove + default: deploy + +permissions: + contents: write + pull-requests: write + +concurrency: + group: storybook-preview-${{ inputs.pr_number }} + cancel-in-progress: true + +env: + SOURCE_DIR: ./apps/react-storybook/storybook-static + +jobs: + preview: + name: ${{ inputs.action }} Storybook preview for PR + runs-on: ubuntu-latest + + environment: preview + + steps: + - name: Checkout PR head commit + if: inputs.action == 'deploy' + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ inputs.pr_number }}/head + fetch-depth: 1 + submodules: true + + - name: Use Node.js + if: inputs.action == 'deploy' + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Setup pnpm + if: inputs.action == 'deploy' + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Get pnpm store directory + if: inputs.action == 'deploy' + shell: bash + run: | + set -euo pipefail + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm + nx cache + if: inputs.action == 'deploy' + uses: actions/cache@v4 + with: + path: | + ${{ env.STORE_PATH }} + .nx/cache + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store + + - name: Install dependencies + if: inputs.action == 'deploy' + run: pnpm install --frozen-lockfile + + - name: Build Storybook preview (static) + if: inputs.action == 'deploy' + run: | + pnpm nx build devextreme-react-storybook + + - name: Deploy/remove PR preview + uses: rossjrw/pr-preview-action@8ff09e486b4c23709012eedd3b42e9f0b95dd0c5 # v1 + with: + action: ${{ inputs.action }} + pr-number: ${{ inputs.pr_number }} + source-dir: ${{ env.SOURCE_DIR }} + preview-branch: gh-pages + umbrella-dir: preview + comment: false + token: ${{ secrets.CHECKOUT_TOKEN }} From ddc50169bfba0a1947434886fa117053a0f88f12 Mon Sep 17 00:00:00 2001 From: Ruslan Farkhutdinov Date: Mon, 2 Feb 2026 13:52:22 +0200 Subject: [PATCH 2/6] Storybook: Update GITHUB_TOKEN secret --- .github/workflows/pr-storybook-deploy-manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-storybook-deploy-manual.yml b/.github/workflows/pr-storybook-deploy-manual.yml index 86e97cd3ef21..90576bd28afa 100644 --- a/.github/workflows/pr-storybook-deploy-manual.yml +++ b/.github/workflows/pr-storybook-deploy-manual.yml @@ -91,4 +91,4 @@ jobs: preview-branch: gh-pages umbrella-dir: preview comment: false - token: ${{ secrets.CHECKOUT_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} From 5d7ef8d5878f52283210997d12870a597f801657 Mon Sep 17 00:00:00 2001 From: Ruslan Farkhutdinov Date: Mon, 2 Feb 2026 15:13:00 +0200 Subject: [PATCH 3/6] Storybook: Update environment name --- .github/workflows/pr-storybook-deploy-manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-storybook-deploy-manual.yml b/.github/workflows/pr-storybook-deploy-manual.yml index 90576bd28afa..1aa677a8a68f 100644 --- a/.github/workflows/pr-storybook-deploy-manual.yml +++ b/.github/workflows/pr-storybook-deploy-manual.yml @@ -32,7 +32,7 @@ jobs: name: ${{ inputs.action }} Storybook preview for PR runs-on: ubuntu-latest - environment: preview + environment: github-pages steps: - name: Checkout PR head commit From 641687a215e4247d7e6e42d24ecd0d3afedfaa42 Mon Sep 17 00:00:00 2001 From: Ruslan Farkhutdinov Date: Mon, 2 Feb 2026 15:42:19 +0200 Subject: [PATCH 4/6] Fix notes --- .github/workflows/pr-storybook-deploy-manual.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-storybook-deploy-manual.yml b/.github/workflows/pr-storybook-deploy-manual.yml index 1aa677a8a68f..ff61acacfbda 100644 --- a/.github/workflows/pr-storybook-deploy-manual.yml +++ b/.github/workflows/pr-storybook-deploy-manual.yml @@ -41,7 +41,6 @@ jobs: with: ref: refs/pull/${{ inputs.pr_number }}/head fetch-depth: 1 - submodules: true - name: Use Node.js if: inputs.action == 'deploy' @@ -59,7 +58,6 @@ jobs: if: inputs.action == 'deploy' shell: bash run: | - set -euo pipefail echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - name: Setup pnpm + nx cache From 9b5b4282a18e6b6e223b89e3eb3dd00adaad8960 Mon Sep 17 00:00:00 2001 From: Ruslan Farkhutdinov Date: Mon, 2 Feb 2026 15:43:13 +0200 Subject: [PATCH 5/6] Add timeout --- .github/workflows/pr-storybook-deploy-manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-storybook-deploy-manual.yml b/.github/workflows/pr-storybook-deploy-manual.yml index ff61acacfbda..977677251ab5 100644 --- a/.github/workflows/pr-storybook-deploy-manual.yml +++ b/.github/workflows/pr-storybook-deploy-manual.yml @@ -31,7 +31,7 @@ jobs: preview: name: ${{ inputs.action }} Storybook preview for PR runs-on: ubuntu-latest - + timeout-minutes: 30 environment: github-pages steps: From 03833ed1d9097c8f35858755eec150259f8a56a5 Mon Sep 17 00:00:00 2001 From: Ruslan Farkhutdinov Date: Mon, 2 Feb 2026 15:50:16 +0200 Subject: [PATCH 6/6] Use pnpx instead of pnpm --- .github/workflows/pr-storybook-deploy-manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-storybook-deploy-manual.yml b/.github/workflows/pr-storybook-deploy-manual.yml index 977677251ab5..c3a57217995f 100644 --- a/.github/workflows/pr-storybook-deploy-manual.yml +++ b/.github/workflows/pr-storybook-deploy-manual.yml @@ -78,7 +78,7 @@ jobs: - name: Build Storybook preview (static) if: inputs.action == 'deploy' run: | - pnpm nx build devextreme-react-storybook + pnpx nx build devextreme-react-storybook - name: Deploy/remove PR preview uses: rossjrw/pr-preview-action@8ff09e486b4c23709012eedd3b42e9f0b95dd0c5 # v1