Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Github Pages deployment config

Blue Mouse1048756c5311
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 000000000..0dc2adb0a
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,63 @@
+name: Deploy Docs to GitHub Pages
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - "docs/**"
+ pull_request:
+ branches:
+ - main
+ paths:
+ - "docs/**"
+
+permissions:
+ contents: write
+
+defaults:
+ run:
+ working-directory: docs
+
+jobs:
+ test-deploy:
+ name: Test deployment
+ if: github.event_name == 'pull_request'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+ cache-dependency-path: docs/package-lock.json
+ - name: Install dependencies
+ run: npm ci
+ - name: Test build website
+ run: npm run build
+
+ deploy:
+ name: Deploy to GitHub Pages
+ if: github.event_name == 'push'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+ cache-dependency-path: docs/package-lock.json
+ - name: Install dependencies
+ run: npm ci
+ - name: Build website
+ run: npm run build
+ - name: Deploy to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./docs/build
+ cname: docs.swetrix.com
diff --git a/docs/package.json b/docs/package.json
index f140a7764..03079f7aa 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -7,7 +7,7 @@
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
- "deploy": "docusaurus deploy",
+ "deploy": "GIT_USER=git docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"format": "prettier --write .",
diff --git a/docs/static/CNAME b/docs/static/CNAME
new file mode 100644
index 000000000..27bbe5c21
--- /dev/null
+++ b/docs/static/CNAME
@@ -0,0 +1 @@
+docs.swetrix.com
diff --git a/docs/wrangler.jsonc b/docs/wrangler.jsonc
deleted file mode 100644
index a688a2818..000000000
--- a/docs/wrangler.jsonc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "$schema": "node_modules/wrangler/config-schema.json",
- "name": "docs-monorepo",
- "compatibility_date": "2025-12-27",
- "assets": {
- "directory": "./build"
- }
-}