diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index e6215e6..82e4a3a 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -22,6 +22,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + + - run: echo "PREVIEW_PATH=pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV" - name: Install and Build if: github.event.action != 'closed' # Skip the build if the PR has been closed diff --git a/docusaurus.config.ts b/docusaurus.config.ts index a103580..16576f7 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -2,6 +2,13 @@ import { themes as prismThemes } from 'prism-react-renderer'; import type { Config } from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; +// Set the // pathname under which your site is served +// For GitHub pages deployment, it is often '//' +let baseUrl = '/rts-docs-dev/'; +if (process.env.PREVIEW_PATH) { + baseUrl += process.env.PREVIEW_PATH; +} + const config: Config = { title: 'Research Technology Servcies', tagline: 'NYU', @@ -11,7 +18,7 @@ const config: Config = { url: 'https://your-docusaurus-site.example.com', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/rts-docs-dev/', + baseUrl: baseUrl, // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these.