Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ⚠️ GitHub Pages 仅能托管 H5 静态前端。
# ClawApp 是前后端一体应用,用户仍需自行部署 server 端(WebSocket 代理)才能实际使用。
# 此工作流仅构建并部署 h5/ 目录下的前端资源到 GitHub Pages。

name: Deploy to GitHub Pages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Install dependencies
working-directory: ./h5
run: npm ci

- name: Build
working-directory: ./h5
run: npx vite build --base /${{ github.event.repository.name }}/

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./h5/dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ pm2 start server/index.js --name clawapp
pm2 save && pm2 startup
```

### GitHub Pages 部署(仅前端)

项目自带 GitHub Actions 工作流(`.github/workflows/deploy-pages.yml`),push 到 `main` 分支后会自动将 H5 前端部署到 GitHub Pages。

> ⚠️ **注意:** ClawApp 是前后端一体应用,GitHub Pages 只能托管 H5 静态前端。用户**仍需自行部署 server 端**(WebSocket 代理服务)才能实际使用聊天功能。Pages 上的前端页面需要连接到一个运行中的 ClawApp Server,参见上方的部署方式。

---

<h2 id="remote">外网访问</h2>
Expand Down