diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
new file mode 100644
index 00000000..2e801bda
--- /dev/null
+++ b/.github/workflows/build-docs.yml
@@ -0,0 +1,37 @@
+name: Build Docs
+
+on: push
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ name: Build Docs
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v6
+
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@v5
+ with:
+ global-json-file: global.json
+
+ - name: Restore docfx
+ working-directory: docs
+ run: dotnet tool restore
+
+ - name: Restore Projects
+ run: |
+ dotnet restore PowerSync/PowerSync.Common/PowerSync.Common.csproj -p:TargetFrameworks=net8.0
+ dotnet restore PowerSync/PowerSync.Maui/PowerSync.Maui.csproj -p:TargetFrameworks=net8.0
+
+ - name: Generate API Metadata
+ working-directory: docs
+ run: dotnet docfx metadata docfx.json --warningsAsErrors --noRestore
+
+ - name: Build Docs
+ working-directory: docs
+ run: dotnet docfx build docfx.json --warningsAsErrors
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 00000000..2a4db78b
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,61 @@
+name: Deploy Docs to GitHub Pages
+
+on: workflow_dispatch
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+concurrency:
+ group: "pages"
+ cancel-in-progress: false
+
+jobs:
+ build:
+ name: Build Docs
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v6
+
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@v5
+ with:
+ global-json-file: global.json
+
+ - name: Restore docfx
+ working-directory: docs
+ run: dotnet tool restore
+
+ - name: Restore Projects
+ run: |
+ dotnet restore PowerSync/PowerSync.Common/PowerSync.Common.csproj -p:TargetFrameworks=net8.0
+ dotnet restore PowerSync/PowerSync.Maui/PowerSync.Maui.csproj -p:TargetFrameworks=net8.0
+
+ - name: Generate API Metadata
+ working-directory: docs
+ run: dotnet docfx metadata docfx.json --warningsAsErrors --noRestore
+
+ - name: Build Docs
+ working-directory: docs
+ run: dotnet docfx build docfx.json --warningsAsErrors
+
+ - name: Upload Pages Artifact
+ uses: actions/upload-pages-artifact@v3
+ with:
+ path: ./docs/_site
+
+ deploy:
+ name: Deploy to GitHub Pages
+ runs-on: ubuntu-latest
+ needs: build
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/Directory.build.props b/Directory.build.props
index bcdc24ac..fe14bb0e 100644
--- a/Directory.build.props
+++ b/Directory.build.props
@@ -2,8 +2,9 @@
Redirecting to the PowerSync .NET API reference.
+ + diff --git a/docs/template/public/main.css b/docs/template/public/main.css new file mode 100644 index 00000000..316cb046 --- /dev/null +++ b/docs/template/public/main.css @@ -0,0 +1,5 @@ +img#logo { + height: 28px; + width: auto; + margin-right: 0.5rem; +} diff --git a/docs/toc.yml b/docs/toc.yml new file mode 100644 index 00000000..8c52d26d --- /dev/null +++ b/docs/toc.yml @@ -0,0 +1,2 @@ +- name: API Reference + uid: PowerSync