Skip to content
Draft
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
53 changes: 53 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy HAAPI React SDK docs (GitHub Pages)

# Publishes the Docusaurus docs at https://curityio.github.io/ui-kit/haapi-react-sdk/docs/.
# Demo deploy from the docs feature branch; retarget `branches` to dev/main when promoting.
on:
push:
branches:
- feature/IS-11008/haapi-react-sdk-docs-github-page
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent Pages deployment; let an in-flight run finish.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- name: Build docs
env:
DOCS_URL: https://curityio.github.io
DOCS_BASE_URL: /ui-kit/haapi-react-sdk/docs/
run: npm run docs:build -w @curity/haapi-react-sdk-docs
# GitHub Pages serves the artifact at /ui-kit/; nest the site so the URL is /ui-kit/haapi-react-sdk/docs/.
- name: Stage site under /haapi-react-sdk/docs
run: |
mkdir -p _site/haapi-react-sdk/docs
cp -r src/haapi-react-sdk/docs/build/. _site/haapi-react-sdk/docs/
- uses: actions/upload-pages-artifact@v3
with:
path: _site

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
9 changes: 7 additions & 2 deletions src/haapi-react-sdk/docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ import type * as Preset from '@docusaurus/preset-classic';
const config: Config = {
title: 'HAAPI React SDK',
tagline: 'Interactive HAAPI React SDK documentation',
url: 'http://localhost',
baseUrl: '/',
// Deploy target is env-driven so local/StackBlitz stay at `/` while CI builds for GitHub Pages
// (e.g. DOCS_URL=https://curityio.github.io, DOCS_BASE_URL=/ui-kit/haapi-react-sdk/docs/).
url: process.env.DOCS_URL ?? 'http://localhost',
baseUrl: process.env.DOCS_BASE_URL ?? '/',
organizationName: 'curityio',
projectName: 'ui-kit',
trailingSlash: false,
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
onBrokenMarkdownLinks: 'throw',
Expand Down
Loading