From dd1c29cc5777ab43b2e9b9faf0f2b56d20dae459 Mon Sep 17 00:00:00 2001 From: Aleix Suau Date: Thu, 25 Jun 2026 09:01:20 +0200 Subject: [PATCH] IS-11008 Add GitHub Pages deploy workflow for HAAPI React SDK docs Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/deploy-docs.yml | 53 +++++++++++++++++++ src/haapi-react-sdk/docs/docusaurus.config.ts | 9 +++- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..a569a843 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -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 diff --git a/src/haapi-react-sdk/docs/docusaurus.config.ts b/src/haapi-react-sdk/docs/docusaurus.config.ts index 59b5622e..3707c490 100644 --- a/src/haapi-react-sdk/docs/docusaurus.config.ts +++ b/src/haapi-react-sdk/docs/docusaurus.config.ts @@ -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',