carbon-platform icon indicating copy to clipboard operation
carbon-platform copied to clipboard

Add Storybook deployment to PRs

Open alisonjoseph opened this issue 2 years ago • 5 comments

Every time a PR is opened, reopened or pushed to, a storybook preview url is added to the PR

NEW SOLUTION:

  • Create a new IBM Cloud Object Storage bucket "mdx-components-pr-builds"
    • Every time a pr is opened, reopened or pushed to and storybook files are changed:
      • build storybook
      • push build artifacts to the new bucket under pr/[PR_NUMBER]/*
      • add a github comment to the pr with the deployment link
  • Set a retention policy on the COS bucket to delete stale files

(previous solution) Will solve this with github actions: From #694

  • Create github action inside carbon-platform repo with the following specifications:
    • Every time a pr is opened, reopened or pushed to and storybook files are changed:
    • build storybook , output to docs-build folder
    • commit output folder to repo from step 1 (docs/pr/{PR_NUMBER}) (might or might not need a github token for this, TBD)
  • Optional but recommended: github action to delete PR folder in separate repo when PR is merged in or closed so that deployment gets deleted.

alisonjoseph avatar Jun 16 '22 15:06 alisonjoseph

Confirmed will need a token, working example: https://github.com/francinelucca/storybook-test/blob/main/.github/workflows/storybook.yml

francinelucca avatar Jun 22 '22 13:06 francinelucca

Hey team! Please add your planning poker estimate with ZenHub @alisonjoseph @andreancardona @jdharvey-ibm

mattrosno avatar Jun 23 '22 15:06 mattrosno

@carbon-design-system/carbon-platform-devs do we still want to do this for our MDX docs in Storybook (https://platform.carbondesignsystem.com)? If so, we can keep this in our backlog. Just checking.

mattrosno avatar Oct 07 '22 12:10 mattrosno

I discussed this implementation briefly with @jdharvey-ibm last week and my understanding is we're still aiming to move forward on this. Definitely open to discussion though!

francinelucca avatar Oct 07 '22 13:10 francinelucca

Yeah! We absolutely want this. This is a really important and wide-reaching external, so having PR deploy previews, snapshots, and Percy VRT hooked up to it will be super useful.

jharvey10 avatar Oct 11 '22 18:10 jharvey10