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
20 changes: 12 additions & 8 deletions .github/workflows/pull_request_docs_preview.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "🦕 Docusaurus Documentation Website (PR Preview)"
name: "🦕 Docusaurus Documentation Website (PR Preview)"

on:
pull_request:
Expand All @@ -9,6 +9,9 @@ on:
- reopened
- synchronize
- closed
paths:
- 'website/**'
- '.github/workflows/pull_request_docs_preview.yml'

permissions:
contents: write
Expand All @@ -20,11 +23,12 @@ defaults:

jobs:
deploy-preview:
if: github.event.pull_request.head.ref != 'release-prep'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
Expand All @@ -34,29 +38,29 @@ jobs:

- name: Install dependencies
run: npm ci

- name: Build website
run: npm run build
env:
DOCUSAURUS_BASE_URL: /pr-preview/pr-${{ github.event.pull_request.number }}/
PR_NUMBER: ${{ github.event.pull_request.number }}

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./website/build/

# - name: Comment PR
# uses: actions/github-script@v7
# with:
# script: |
# const url = `https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.pull_request.number }}/`;
# const comment = `### 📖 Documentation Preview

# The documentation preview for this PR is available at:
# ${url}

# This preview will be updated automatically when the PR is updated.`;

# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Release

on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- CHANGELOG.md

permissions:
contents: write
Expand Down
7 changes: 6 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { themes as prismThemes } from "prism-react-renderer";

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const BASE_URL =
process.env.PR_NUMBER !== undefined
? `/busly-cli/pr-preview/pr-${process.env.PR_NUMBER}/`
: "/busly-cli";

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Busly CLI for NServiceBus",
Expand All @@ -21,7 +26,7 @@ const config = {
url: "https://tragiccode.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/busly-cli",
baseUrl: BASE_URL,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down