diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml index 4debe4f126..e50a42e87c 100644 --- a/.github/workflows/publish-pages.yml +++ b/.github/workflows/publish-pages.yml @@ -1,7 +1,7 @@ on: # Runs on pushes targeting the default branch push: - branches: [main] + branches: [main, cc/fix-storybook-static-dir] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -9,6 +9,8 @@ on: jobs: build: runs-on: ubuntu-latest + env: + STORYBOOK_ROOT_URL: ${{ github.event.repository.name }} steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 diff --git a/frontends/mit-open/.storybook/main.ts b/frontends/mit-open/.storybook/main.ts index 704846239a..839cb30447 100644 --- a/frontends/mit-open/.storybook/main.ts +++ b/frontends/mit-open/.storybook/main.ts @@ -19,7 +19,9 @@ const config = { "../../ol-components/src/**/*.mdx", "../../ol-components/src/**/*.stories.@(tsx|ts)", ], - staticDirs: [{ from: "../public", to: "/static" }], + staticDirs: [ + { from: "../public", to: `${process.env.STORYBOOK_ROOT_URL ?? ""}/static` }, + ], addons: [ getAbsolutePath("@storybook/addon-links"), getAbsolutePath("@storybook/addon-essentials"),