bitovi / github-actions-storybook-to-github-pages

Deploy a Storybook build to GitHub Pages
MIT License
34 stars 5 forks source link

Yarn support #3

Closed jonniebigodes closed 11 months ago

jonniebigodes commented 11 months ago

While testing this action as part of the following pull request, I've encountered an issue with the action throwing an error if a different package manager (i.e., Yarn) was provided, leaving me and other users in a state where they're unable to publish their Storybook documentation unless they use npm.

For context, I've set up a small reproduction here and looking at the action runs I was wondering if there's an opening for supporting Yarn as a package manager so that the associated Storybook documentation pull request can be reviewed properly and get merged in and make it available to our readers.

Let me know and we'll go from there.

Hope you have a fantastic rest of the week.

Stay safe

mickmcgrath13 commented 11 months ago

Hey @jonniebigodes,

The default build command is npm run build-storybook.

The build_command input allows this to be overwritten to:

    - id: build-publish
      uses: bitovi/github-actions-storybook-to-github-pages@v1.0.0
      with:
        build_command: yarn run build-storybook

However, we should surface the install command as well (similar to this):

    - id: build-publish
      uses: bitovi/github-actions-storybook-to-github-pages@v1.0.0
      with:
        install_command: yarn install
        build_command: yarn run build-storybook
mickmcgrath13 commented 11 months ago

also @jonniebigodes, thanks for the submission! We'll get a fix out shortly.

Would the above proposal (specify build_command and introduce install_command so it can be specified as well) be aligned with how you'd expect to use it?

Alternatively, we could have a use_yarn: true sort of option, but I feel like the build_command and install_command are going to be more flexible and easier to maintain.

jonniebigodes commented 11 months ago

@mickmcgrath13 thanks for following up with me on this. Appreciate it. And I'm with you on the change. I think that adding both the build_command and install_command options would be more flexible as not only opens it up to the Yarn package manager but potentially to others as well.

Let me know once you've updated so that it can be also updated in the Storybook documentation and get it properly reviewed.

Have a fantastic day.

Stay safe