diff --git a/.github/workflows/storybook.yml b/.github/workflows/docs.yml similarity index 69% rename from .github/workflows/storybook.yml rename to .github/workflows/docs.yml index 49222b758..94564d7fe 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: Build & Publish Storybook +name: Build & Publish Docs & Storybook on: push: @@ -7,13 +7,13 @@ on: - develop paths: - 'frontend/**' - - '.github/workflows/storybook.yml' + - '.github/workflows/docs.yml' - '.yarn/**' - '.storybook/**' pull_request: paths: - 'frontend/**' - - '.github/workflows/storybook.yml' + - '.github/workflows/docs.yml' - '.yarn/**' - '.storybook/**' @@ -27,23 +27,34 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Build ER/MKDOCS site + run: | + mkdir -p docs-pages + sudo docker compose --env-file .env-github-actions run server bash -c "mkdocs build -d ./docs-pages-build" + cp -r ./backend/docs-pages-build/* ./docs-pages + - name: Install dependencies run: yarn working-directory: ./frontend + - name: Build Storybook - run: yarn storybook:build + run: yarn storybook:build --output-dir ../docs-pages/storybook working-directory: ./frontend + - name: Setup Github Pages uses: actions/configure-pages@v2 + - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ./frontend/storybook-static + path: ./docs-pages + - name: Archive production artifacts uses: actions/upload-artifact@v3 with: name: build - path: ./frontend/storybook-static + path: ./docs-pages deploy-gh-pages: # only deploy on develop branch diff --git a/frontend/.storybook/main.js b/frontend/.storybook/main.js index 90fbf71bf..9da30e2da 100644 --- a/frontend/.storybook/main.js +++ b/frontend/.storybook/main.js @@ -30,6 +30,7 @@ const config = { viteFinal: (config) => { return mergeConfig(config, { + base: "/MUSCLE/storybook/", resolve: { alias: { '@/': '/src/',