Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

ci: deploy demo on published release

tianma-ifa16d31fcaf7d
diff --git a/.github/workflows/deploy-demo-on-release.yml b/.github/workflows/deploy-demo-on-release.yml
new file mode 100644
index 00000000..d46aa1ad
--- /dev/null
+++ b/.github/workflows/deploy-demo-on-release.yml
@@ -0,0 +1,54 @@
+name: Deploy Demo on Release
+
+on:
+ release:
+ types:
+ - published
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: edgeever-demo-deployment
+ cancel-in-progress: false
+
+jobs:
+ deploy:
+ name: Build and deploy Demo Worker
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ env:
+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ EDGE_EVER_WORKER_NAME: ${{ secrets.EDGE_EVER_DEMO_WORKER_NAME }}
+ EDGE_EVER_D1_DATABASE_NAME: ${{ secrets.EDGE_EVER_DEMO_D1_DATABASE_NAME }}
+ EDGE_EVER_D1_DATABASE_ID: ${{ secrets.EDGE_EVER_DEMO_D1_DATABASE_ID }}
+ EDGE_EVER_R2_BUCKET_NAME: ${{ secrets.EDGE_EVER_DEMO_R2_BUCKET_NAME }}
+ EDGE_EVER_R2_PREVIEW_BUCKET_NAME: ${{ secrets.EDGE_EVER_DEMO_R2_PREVIEW_BUCKET_NAME }}
+ EDGE_EVER_AUTH_USERNAME: ${{ secrets.EDGE_EVER_DEMO_AUTH_USERNAME }}
+ EDGE_EVER_SESSION_TTL_DAYS: ${{ secrets.EDGE_EVER_DEMO_SESSION_TTL_DAYS }}
+ EDGE_EVER_DEMO_MODE: "true"
+ EDGE_EVER_DEMO_RESET_CRON: "0 19 * * *"
+ EDGE_EVER_CUSTOM_DOMAIN: ${{ secrets.EDGE_EVER_DEMO_CUSTOM_DOMAIN }}
+
+ steps:
+ - name: Checkout release
+ uses: actions/checkout@v5
+ with:
+ ref: ${{ github.event.release.tag_name || github.ref }}
+
+ - name: Set up Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+
+ - name: Deploy Demo Worker
+ run: bun run deploy
+
+ - name: Verify Demo URL
+ if: env.EDGE_EVER_CUSTOM_DOMAIN != ''
+ run: curl --fail --silent --show-error --location --max-time 20 "https://${EDGE_EVER_CUSTOM_DOMAIN}/"
diff --git a/docs/cloudflare-workers-builds.md b/docs/cloudflare-workers-builds.md
index 486cb5a6..82b465e5 100644
--- a/docs/cloudflare-workers-builds.md
+++ b/docs/cloudflare-workers-builds.md
@@ -1,6 +1,6 @@
# Cloudflare Workers Builds
-Cloudflare Workers Builds deploys EdgeEver whenever `main` changes. Cloudflare one-click deployment connects it automatically; CLI installations use local `bun run deploy:manual` only for first installation or emergency recovery.
+Cloudflare Workers Builds deploys EdgeEver whenever `main` changes. Cloudflare one-click deployment connects it automatically; CLI installations use local `bun run deploy:manual` only for first installation or emergency recovery. The official Demo Worker is additionally deployed by the `Deploy Demo on Release` workflow whenever a formal GitHub Release is published.
## Setup
@@ -41,6 +41,6 @@ If the command reports that no deployment API token is available, open **Worker*
## Updates and Troubleshooting
-After setup, every push to `main` makes Cloudflare install dependencies, check and build the app, apply new D1 migrations, deploy the Worker, and verify the result. The **Update deployed EdgeEver** GitHub workflow supplies upstream updates daily: `stable` follows formal Releases by default, while the repository variable `EDGE_EVER_UPDATE_CHANNEL=edge` follows upstream `main`. No Cloudflare deployment secrets or local redeployment are required in GitHub Actions.
+After setup, every push to `main` makes Cloudflare install dependencies, check and build the app, apply new D1 migrations, deploy the Worker, and verify the result. For the official Demo Worker, publishing a formal Release triggers an immediate deployment from that Release tag through the `Deploy Demo on Release` GitHub workflow. Other self-hosted deployment repositories can use the **Update deployed EdgeEver** workflow, which checks upstream daily: `stable` follows formal Releases by default, while the repository variable `EDGE_EVER_UPDATE_CHANNEL=edge` follows upstream `main`. No Cloudflare deployment secrets or local redeployment are required in GitHub Actions.
If a build fails, inspect its log in the Worker **Deployments** tab. Rerun `bun run deploy:builds:setup` when instance settings change.
diff --git a/docs/cloudflare-workers-builds.zh-CN.md b/docs/cloudflare-workers-builds.zh-CN.md
index 6f888b25..74c2a776 100644
--- a/docs/cloudflare-workers-builds.zh-CN.md
+++ b/docs/cloudflare-workers-builds.zh-CN.md
@@ -1,6 +1,6 @@
# Cloudflare Workers Builds 自动部署
-Cloudflare Workers Builds 会在 `main` 发生变化时自动部署 EdgeEver。Cloudflare 一键部署会自动完成连接;CLI 安装只在首次部署或紧急修复时使用本地 `bun run deploy:manual`。
+Cloudflare Workers Builds 会在 `main` 发生变化时自动部署 EdgeEver。Cloudflare 一键部署会自动完成连接;CLI 安装只在首次部署或紧急修复时使用本地 `bun run deploy:manual`。官方 Demo Worker 还会在 GitHub 正式 Release 发布后,由 `Deploy Demo on Release` 工作流立即部署。
## 配置
@@ -41,6 +41,6 @@ EDGE_EVER_BUILDS_API_TOKEN=<token>
## 更新与排错
-配置完成后,任何推送到 `main` 的提交都会让 Cloudflare 安装依赖、检查并构建应用、执行新的 D1 migration、部署 Worker 并验证结果。GitHub 中的 **Update deployed EdgeEver** 工作流每天提供上游更新:默认 `stable` 跟随正式 Release,设置 Repository Variable `EDGE_EVER_UPDATE_CHANNEL=edge` 后跟随上游 `main`。GitHub Actions 不需要保存 Cloudflare 部署 Secret,也不需要本地重新部署。
+配置完成后,任何推送到 `main` 的提交都会让 Cloudflare 安装依赖、检查并构建应用、执行新的 D1 migration、部署 Worker 并验证结果。官方 Demo Worker 在发布正式 Release 时,会通过 GitHub 的 `Deploy Demo on Release` 工作流从 Release 标签立即部署。其他自托管部署仓库可以使用 **Update deployed EdgeEver** 工作流每天检查上游:默认 `stable` 跟随正式 Release,设置 Repository Variable `EDGE_EVER_UPDATE_CHANNEL=edge` 后跟随上游 `main`。GitHub Actions 不需要保存 Cloudflare 部署 Secret,也不需要本地重新部署。
构建失败时,在 Worker 的 **Deployments** 页面查看日志。实例配置变化后,重新执行 `bun run deploy:builds:setup`。