Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Docs Preview

on:
push:
branches: [main]
paths:
- 'docs/**'
- 'src/**'
- 'script/generate-command-docs.ts'
- 'script/generate-skill.ts'
- 'install'
- '.github/workflows/docs-preview.yml'
pull_request:
paths:
- 'docs/**'
Expand All @@ -14,6 +23,10 @@ permissions:
contents: write
pull-requests: write

concurrency:
group: docs-preview-${{ github.ref }}
cancel-in-progress: true

jobs:
preview:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -41,8 +54,9 @@ jobs:
- name: Build Docs for Preview
working-directory: docs
env:
# Override base path for PR preview (no /cli prefix since preview domain is different)
DOCS_BASE_PATH: /pr-preview/pr-${{ github.event.pull_request.number }}
DOCS_BASE_PATH: ${{ github.event_name == 'push'
&& '/_preview/pr-main'
|| format('/_preview/pr-{0}', github.event.pull_request.number) }}
PUBLIC_SENTRY_ENVIRONMENT: staging
SENTRY_RELEASE: ${{ steps.version.outputs.version }}
PUBLIC_SENTRY_RELEASE: ${{ steps.version.outputs.version }}
Expand Down Expand Up @@ -102,6 +116,8 @@ jobs:
with:
source-dir: docs/dist/
preview-branch: gh-pages
umbrella-dir: pr-preview
umbrella-dir: _preview
pages-base-url: cli.sentry.dev
action: auto
action: ${{ github.event_name == 'push' && 'deploy' || 'auto' }}
pr-number: ${{ github.event_name == 'push' && 'main' || github.event.pull_request.number }}
comment: ${{ github.event_name != 'push' }}
2 changes: 1 addition & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default defineConfig({
const path = window.location.pathname;
// Works with both / (prod) and /pr-preview/pr-XX (preview)
return path === '/' ||
/^\\/pr-preview\\/pr-\\d+\\/?$/.test(path);
/^\\/_preview\\/pr-(\\d+|main)\\/?$/.test(path);
}

function checkAtBottom() {
Expand Down
Loading