diff --git a/.storybook/preview.js b/.storybook/preview.js index 2d821eb..5226312 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,4 +1,5 @@ /** @type { import('@storybook/react').Preview } */ +const isGithubBuild = !!process.env["GITHUB_REPOSITORY"] const preview = { parameters: { branches: { @@ -13,4 +14,11 @@ const preview = { }, }; +if (isGithubBuild) { + const [owner, repo] = GITHUB_REPOSITORY.split("/") + preview.parameters["branches"] = { + hostname: `${owner}.github.io/${repo}`, + } +} + export default preview;