Skip to content

Commit

Permalink
Getting baseUrl from env
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Aug 21, 2024
1 parent 91fa817 commit ee69296
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
if: steps.cache-build.outputs.cache-hit != 'true' && github.event.action != 'closed' # Skip if the PR was closed
run: |
npm run build
- name: Set preview path
run: echo "PREVIEW_PATH=sauce-docs/pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV"

- name: Deploy PR preview
uses: rossjrw/pr-preview-action@v1
Expand Down
7 changes: 6 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
const unwrapJsx = require('./src/plugins/unwrap-jsx');

// Enabling PR previews
let siteBaseUrl = "/"
if (process.env.PREVIEW_PATH) siteBaseUrl += process.env.PREVIEW_PATH

const docusaurusConfig = {
title: 'Sauce Labs Documentation',
tagline: 'Test all the things.',
url: 'https://docs.saucelabs.com',
noIndex: process.env.NO_INDEX,
trailingSlash: true,
baseUrl: '/',
baseUrl: siteBaseUrl,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
organizationName: 'saucelabs',
Expand Down

0 comments on commit ee69296

Please sign in to comment.