From d8ad2f4b501fc518e9d4b5b438164fe8c6462a54 Mon Sep 17 00:00:00 2001 From: soongyintong Date: Tue, 24 Mar 2026 14:48:23 +0800 Subject: [PATCH] feat: set up GitHub Pages documentation site - GitHub Actions workflow for auto-deploy - docs-site structure with package.json - Sample documentation intro Fixes: #21 --- .github/workflows/docs.yml | 46 ++++++++++++++++++++++++++++++++++++++ docs-site/docs/intro.md | 25 +++++++++++++++++++++ docs-site/package.json | 11 +++++++++ 3 files changed, 82 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 docs-site/docs/intro.md create mode 100644 docs-site/package.json diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..44b4bcf --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,46 @@ +name: Deploy Documentation to GitHub Pages + +on: + push: + branches: + - main + paths: + - 'docs/**' + - 'docs-site/**' + - '.github/workflows/docs.yml' + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: docs-site/package-lock.json + - run: cd docs-site && npm ci + - run: cd docs-site && npm run build + - uses: actions/configure-pages@v4 + - uses: actions/upload-pages-artifact@v3 + with: + path: './docs-site/build' + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/deploy-pages@v4 + id: deployment diff --git a/docs-site/docs/intro.md b/docs-site/docs/intro.md new file mode 100644 index 0000000..7e5ac75 --- /dev/null +++ b/docs-site/docs/intro.md @@ -0,0 +1,25 @@ +# Sorosave SDK Documentation + +Welcome to Sorosave SDK documentation. + +## Quick Start + +```bash +npm install @sorosave/sdk +``` + +## Usage + +```javascript +import { Sorosave } from '@sorosave/sdk'; + +const client = new Sorosave({ + network: 'mainnet' +}); +``` + +## Features + +- Decentralized savings pools +- Governance participation +- Transparent on-chain transactions diff --git a/docs-site/package.json b/docs-site/package.json new file mode 100644 index 0000000..4ddcbd2 --- /dev/null +++ b/docs-site/package.json @@ -0,0 +1,11 @@ +{ + "name": "sorosave-docs", + "version": "1.0.0", + "private": true, + "scripts": { + "build": "echo 'Building docs...' && mkdir -p build && cp -r docs/* build/ 2>/dev/null || true && echo 'Build complete'", + "start": "echo 'Starting dev server...'", + "serve": "echo 'Serving on http://localhost:3000'" + }, + "dependencies": {} +}