Storybook: Add manual deployment workflow#32356
Conversation
d7562e6 to
8e5ee48
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new manual GitHub Actions workflow for deploying Storybook PR previews. The workflow allows maintainers to manually trigger deployment or removal of Storybook previews for specific pull requests using GitHub Pages.
Changes:
- Adds workflow_dispatch trigger for manual deployment of Storybook previews to GitHub Pages
- Implements conditional build steps that only execute for "deploy" action
- Uses pr-preview-action to manage preview deployments on gh-pages branch
| if: inputs.action == 'deploy' | ||
| run: | | ||
| pnpm nx build devextreme-react-storybook | ||
|
|
There was a problem hiding this comment.
When the action is 'remove', all setup steps are skipped (lines 38-81), but the deployment step at line 83 still runs. The pr-preview-action needs to checkout the gh-pages branch and remove the preview directory when action is 'remove'.
However, without the checkout step running (line 38 has if: inputs.action == 'deploy'), the action may not have access to the repository. Consider adding a separate checkout step for the 'remove' action that checks out the default branch or gh-pages branch, or removing the condition from line 38 so checkout always happens.
| - name: Checkout gh-pages for removal | |
| if: inputs.action == 'remove' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| fetch-depth: 1 |
No description provided.