CivicTechTO / polis-storybook

https://civictechto.github.io/polis-storybook/
GNU Affero General Public License v3.0
1 stars 0 forks source link

Deploy storybook for every pull request #6

Open patcon opened 3 hours ago

patcon commented 3 hours ago

We can use this branch-switcher addon for storybook to allow the single storybook site to switch between code from different branches/PRs: https://github.com/utarwyn/storybook-branch-switcher

It can have each PR generate a build of storybook for its branch: https://github.com/utarwyn/storybook-branch-switcher?tab=readme-ov-file#with-github-opened-prs

Unlike traditional PR flows, it's not deployable a new app for PRs, but instead pushing to the github pages main site (usually only deployed from main branch) for every commit to both mainline and pull request branches.

patcon commented 3 hours ago

This might require some silliness and edge cases when adding new packages in a PR, because they might be missing if that packages are only pulled in from package-lock.json in mainline. To make this work, packages may need to be added to mainline for work happening on branches.

Alternatively, we could gradefully exit the storybook build for branches where diffs exist between the package-lock.json in mainline and a PR branch