From d7dedde724cd6cbf9f12ff7efe986306407615a7 Mon Sep 17 00:00:00 2001 From: Suleiman Shahbari Date: Sat, 27 Jun 2026 22:06:08 +0300 Subject: [PATCH] ci: deploy docs to GitHub Pages Add a Pages deploy workflow (build VitePress, upload, deploy) triggered on docs changes to main and via manual dispatch. Pages source is set to GitHub Actions; the site publishes at https://gemstack-land.github.io/gemstack/. config.ts gains a configurable base (process.env.DOCS_BASE || '/'). The workflow sets DOCS_BASE=/gemstack/ for the project-pages URL; local dev and a future custom domain keep the root base. Drop that env from the workflow once gemstack.land is attached. --- .github/workflows/deploy-docs.yml | 53 +++++++++++++++++++++++++++++++ docs/.vitepress/config.ts | 5 +++ 2 files changed, 58 insertions(+) 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 0000000..4670f7e --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,53 @@ +name: Deploy docs + +on: + push: + branches: [main] + paths: + - 'docs/**' + - '.github/workflows/deploy-docs.yml' + workflow_dispatch: + +# Allow the workflow to publish to GitHub Pages. +permissions: + contents: read + pages: write + id-token: write + +# One in-flight deploy at a time; let a newer push supersede an older one +# (but don't cancel a run mid-publish). +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile + - name: Build docs + env: + # Project-pages base path (gemstack-land.github.io/gemstack/). + # Remove this once a custom domain serves the site at the root. + DOCS_BASE: /gemstack/ + run: pnpm --filter @gemstack/docs docs:build + - uses: actions/configure-pages@v5 + - uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + 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/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index cb1fd5c..74b4284 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -4,6 +4,11 @@ export default defineConfig({ title: 'GemStack', description: 'Framework-agnostic tools for building AI applications in Node.', lang: 'en-US', + // Served at the site root by default (local dev, and a custom domain like + // gemstack.land). The GitHub Pages workflow sets DOCS_BASE=/gemstack/ for the + // project-pages URL (gemstack-land.github.io/gemstack/). Drop that env once a + // custom domain is attached so the base returns to '/'. + base: process.env.DOCS_BASE || '/', ignoreDeadLinks: 'localhostLinks', head: [