From 2bcc58c1b8681e7db3d2baf24ba2ba12c7d86096 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:06:44 +0800 Subject: [PATCH 01/19] add PgDog --- CN/modules/ROOT/nav.adoc | 1 + EN/modules/ROOT/nav.adoc | 1 + 2 files changed, 2 insertions(+) diff --git a/CN/modules/ROOT/nav.adoc b/CN/modules/ROOT/nav.adoc index d0e7dde..8cae5d7 100644 --- a/CN/modules/ROOT/nav.adoc +++ b/CN/modules/ROOT/nav.adoc @@ -65,6 +65,7 @@ *** xref:master/ecosystem_components/pg_hint_plan.adoc[pg_hint_plan] *** xref:master/ecosystem_components/redis_fdw.adoc[redis_fdw] *** xref:master/ecosystem_components/pg_show_plans.adoc[pg_show_plans] +*** xref:master/ecosystem_components/pgdog.adoc[PgDog] * 监控运维 ** xref:master/getting-started/daily_monitoring.adoc[日常监控] ** xref:master/getting-started/daily_maintenance.adoc[日常维护] diff --git a/EN/modules/ROOT/nav.adoc b/EN/modules/ROOT/nav.adoc index 25134d3..0aa7f35 100644 --- a/EN/modules/ROOT/nav.adoc +++ b/EN/modules/ROOT/nav.adoc @@ -65,6 +65,7 @@ *** xref:master/ecosystem_components/pg_hint_plan.adoc[pg_hint_plan] *** xref:master/ecosystem_components/redis_fdw.adoc[redis_fdw] *** xref:master/ecosystem_components/pg_show_plans.adoc[pg_show_plans] +*** xref:master/ecosystem_components/pgdog.adoc[PgDog] * Monitor and O&M ** xref:master/getting-started/daily_monitoring.adoc[Monitoring] ** xref:master/getting-started/daily_maintenance.adoc[Maintenance] From 912b8ac9993d9dbd3e08fccf65a8d409918916ef Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:07:52 +0800 Subject: [PATCH 02/19] add PgDog --- .../master/ecosystem_components/pgdog.adoc | 279 ++++++++++++++++++ .../master/ecosystem_components/pgdog.adoc | 278 +++++++++++++++++ 2 files changed, 557 insertions(+) create mode 100644 CN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc create mode 100644 EN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc diff --git a/CN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc b/CN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc new file mode 100644 index 0000000..b4ece17 --- /dev/null +++ b/CN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc @@ -0,0 +1,279 @@ + +:sectnums: +:sectnumlevels: 5 + += PgDog + +== 概述 +PgDog 是一个专为 PostgreSQL 设计的高性能、开源集群中间件(代理工具),采用 Rust 语言编写。它集成了自动分片、连接池和负载均衡功能,能让开发者在无需修改任何应用程序代码的前提下,实现 PostgreSQL 数据库的水平扩展与高可用管理。 + +注意,PgDog 使用 PostgreSQL 原生的 pg_query 模块实现语句解析,所以暂时不支持在 Oracle 兼容模式下运行。 + +项目地址: + +版本:v0.1.45 + +开源协议:AGPL-3.0 License + +== 安装 + +[TIP] +源码测试安装环境为 Ubuntu 26.04。 + +=== 依赖 + +[source,bash] +---- +sudo apt update && \ +sudo apt install -y cmake clang curl pkg-config \ + libssl-dev git build-essential mold rustup \ + docker +---- + +[TIP] +本文使用说明需要两个IvorySQL数据库实例,可通过本文提供的docker-compose文件快速搭建。安装docker-compose请参考: + +=== 源码安装 + +[source,bash] +---- +wget https://github.com/pgdogdev/pgdog/archive/refs/tags/v0.1.45.tar.gz +tar -zxf v0.1.45.tar.gz +cd pgdog-0.1.45 + +# 编译完后,会在`target/release`目录下生成可执行文件 +cargo build --release +---- + +=== 验证安装 + +[source,bash] +---- +# PgDog在本文档编写时处于快速迭代开发阶段,所以下面命令的输出不完整 +./target/release/pgdog --version +# 输出:PgDog v +---- + +== 配置 + +本文将配置两个分片,对PgDog的自动分片功能为例进行使用说明。 + +PgDog通过两个文件进行配置: + +[cols="1,2"] +|=== +| 文件名 | 说明 + +| pgdog.toml +| 包含PgDog的端口配置、后端PostgreSQL服务的配置等基础配置信息 + +| users.toml +| 访问PgDog的用户名和密码在这里配置 +|=== + + +创建`pgdog.toml`: + +[source,toml] +---- +[general] +host = "0.0.0.0" +port = 6432 +default_pool_size = 10 + +# ---- ivory_shard:分片到两个 IvorySQL 后端 ---- +# host、port以及database_name,如果不是使用本文提供的docker-compose搭建的环境,需要按照实际情况修改 +[[databases]] +name = "ivory_shard" +host = "ivory-shard0" +port = 5432 +database_name = "testdb" +user = "ivorysql" # 如果不提供,默认使用`users.toml`中对应的`name` +password = "ivorysql" # 如果不提供,默认使用`users.toml`中对应的`password` +shard = 0 + +[[databases]] +name = "ivory_shard" +host = "ivory-shard1" +port = 5432 +database_name = "testdb" +shard = 1 + +# ---- 分片键声明 ---- +# 配置必须与实际表结构统一 +[[sharded_tables]] +database = "ivory_shard" +name = "orders" +column = "customer_id" +data_type = "bigint" +---- + +创建`users.toml`: + +[source,toml] +---- +[admin] +name = "admin" +user = "admin" +password = "pgdog" + +[[users]] +name = "ivorysql" +password = "ivorysql" +database = "ivory_shard" +pool_size = 10 +---- + +创建`docker-compose.shard.yml`: + +[TIP] +`volumes`字段请根据实际的配置文件位置进行修改 + +[source,dockerfile] +---- +# 分片测试拓扑(独立 compose):2 个分片后端。 +# ivory-shard0 IvorySQL 5.4 (pg) host:5443 +# ivory-shard1 IvorySQL 5.4 (pg) host:5444 + +x-ivory: &ivory + image: registry.highgo.com/ivorysql/ivorysql:5.4-bookworm + environment: &ivoryenv + MODE: pg + IVORYSQL_USER: ivorysql + IVORYSQL_PASSWORD: ivorysql + IVORYSQL_DB: testdb + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ivorysql -d testdb"] + interval: 5s + timeout: 3s + retries: 30 + +services: + ivory-shard0: + <<: *ivory + container_name: ivory-shard0 + ports: ["5443:5432"] + ivory-shard1: + <<: *ivory + container_name: ivory-shard1 + ports: ["5444:5432"] +---- + +== 使用 + +=== 启动PgDog + +[source,bash] +---- +./target/release/pgdog --config ./pgdog.toml --users ./users.toml +---- + + +=== 管理控制台 + +PgDog 提供了内置的管理数据库,用户名密码通过`users.toml`中`[[admin]]`字段进行配置。 + +[source,bash] +---- +psql "postgres://admin:pgdog@localhost:6433/admin" +---- + +[source,sql] +---- +-- 查看客户端连接及实时统计 +SHOW CLIENTS + +-- 查看从PgDog发起的PostgreSQL连接 +SHOW SERVERS + +-- 查看连接池信息 +SHOW POOLS + +-- 查看当前从pgdog.toml加载的配置 +SHOW CONFIG + +-- 查看连接池统计 +SHOW STATS + +-- 在同一网络中运行的 PgDog 进程列表。需要启用服务发现(service discovery) +SHOW PEERS + +-- 从磁盘重新加载配置。关于哪些选项可以在运行时修改,请参阅 pgdog.toml 和 users.toml +RELOAD + +-- 使用现有配置重新创建所有服务器连接 +RECONNECT + +-- 暂停所有连接池。客户端将一直等待连接,直到连接池恢复。可用于平滑重启 PostgreSQL 服务器 +PAUSE + +-- 恢复所有连接池。客户端可以重新取用连接 +RESUME + +-- 列出当前缓存中的prepared statements +SHOW PREPARED + +-- 列出当前位于 AST 缓存中、用于查询路由的语句 +SHOW QUERY_CACHE + +-- 暂停所有查询,以便在多个 PgDog 实例之间同步配置变更 +MAINTENANCE + +-- 显示每个数据库的 PostgreSQL 复制状态,包括副本延迟 +SHOW REPLICATION +---- + +=== 连接PgDog + +[source,bash] +---- +psql "postgres://ivorysql:ivorysql@localhost:6433/ivory_shard" +---- + +=== 执行操作 + +[TIP] +请确认分片后端没有`orders`表,PgDog会自动创建。 + +[source,sql] +---- +-- 创建表 +CREATE TABLE orders ( + order_id bigint, + customer_id bigint, + amount numeric(10,2), + PRIMARY KEY (order_id, customer_id) +); + +-- 插入数据:这两条数据将分别插入到两个分片后端 +-- BUG:这里不能使用`generate_series`函数,因为PgDog暂时对这个函数进行透传 +INSERT INTO orders values(1, 1, 1); +INSERT INTO orders values(2, 2, 2); +INSERT INTO orders values(3, 3, 3); +INSERT INTO orders values(4, 4, 4); +INSERT INTO orders values(5, 5, 5); +INSERT INTO orders values(6, 6, 6); +INSERT INTO orders values(7, 7, 7); + +-- 查询数据 +SELECT * FROM orders; +---- + +=== 分别连接两个分片后端确认数据 + +[TIP] +这里将看到两个分片后端的条目并不是均分的,这是因为PgDog根据`[[sharded_tables]]`中配置的`customer_id`字段,提取了数值并对其进行HASH分片。 + +[source,bash] +---- +# 分片1 +psql "postgres://ivorysql:ivorysql@localhost:5443/testdb", +# 分片2 +psql "postgres://ivorysql:ivorysql@localhost:5444/testdb", +---- + +在分片后端分别执行查询确认数据 +[source,sql] +---- +SELECT * FROM orders; +---- diff --git a/EN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc b/EN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc new file mode 100644 index 0000000..d2518a2 --- /dev/null +++ b/EN/modules/ROOT/pages/master/ecosystem_components/pgdog.adoc @@ -0,0 +1,278 @@ +:sectnums: +:sectnumlevels: 5 + += PgDog + +== Overview +PgDog is a high-performance, open-source clustering middleware (proxy tool) designed specifically for PostgreSQL and written in Rust. It integrates automatic sharding, connection pooling, and load balancing, enabling developers to achieve horizontal scaling and high-availability management of PostgreSQL databases without modifying any application code. + +Note that PgDog uses PostgreSQL's native pg_query module to parse statements, so it currently does not support Oracle compatibility mode. + +Project URL: + +Version: v0.1.45 + +Open-source license: AGPL-3.0 License + +== Installation + +[TIP] +The source build was tested on Ubuntu 26.04. + +=== Dependencies + +[source,bash] +---- +sudo apt update && \ +sudo apt install -y cmake clang curl pkg-config \ + libssl-dev git build-essential mold rustup \ + docker +---- + +[TIP] +The instructions in this document require two IvorySQL database instances, which can be quickly set up using the docker-compose file provided in this document. To install docker-compose, refer to: + +=== Building from Source + +[source,bash] +---- +wget https://github.com/pgdogdev/pgdog/archive/refs/tags/v0.1.45.tar.gz +tar -zxf v0.1.45.tar.gz +cd pgdog-0.1.45 + +# After compilation, the executable will be generated in the `target/release` directory +cargo build --release +---- + +=== Verifying the Installation + +[source,bash] +---- +# At the time this document was written, PgDog is under rapid iterative development, so the output of the command below is incomplete +./target/release/pgdog --version +# Output: PgDog v +---- + +== Configuration + +This document configures two shards and uses PgDog's automatic sharding feature as an example. + +PgDog is configured through two files: + +[cols="1,2"] +|=== +| File Name | Description + +| pgdog.toml +| Contains basic configuration information such as PgDog's port settings and the backend PostgreSQL service configuration + +| users.toml +| The username and password for accessing PgDog are configured here +|=== + + +Create `pgdog.toml`: + +[source,toml] +---- +[general] +host = "0.0.0.0" +port = 6432 +default_pool_size = 10 + +# ---- ivory_shard: shard across two IvorySQL backends ---- +# host, port, and database_name need to be modified according to your actual setup if you are not using the environment built with the docker-compose provided in this document +[[databases]] +name = "ivory_shard" +host = "ivory-shard0" +port = 5432 +database_name = "testdb" +user = "ivorysql" # if not provide, using `name` in `users.toml` +password = "ivorysql" # if not provide, using `password` in `users.toml` +shard = 0 + +[[databases]] +name = "ivory_shard" +host = "ivory-shard1" +port = 5432 +database_name = "testdb" +shard = 1 + +# ---- Shard key declaration ---- +# The configuration must match the actual table structure +[[sharded_tables]] +database = "ivory_shard" +name = "orders" +column = "customer_id" +data_type = "bigint" +---- + +Create `users.toml`: + +[source,toml] +---- +[admin] +name = "admin" +user = "admin" +password = "pgdog" + +[[users]] +name = "ivorysql" +password = "ivorysql" +database = "ivory_shard" +pool_size = 10 +---- + +Create `docker-compose.shard.yml`: + +[TIP] +Please modify the `volumes` field according to the actual location of your configuration files. + +[source,dockerfile] +---- +# Sharding test topology (standalone compose): 2 shard backends. +# ivory-shard0 IvorySQL 5.4 (pg) host:5443 +# ivory-shard1 IvorySQL 5.4 (pg) host:5444 + +x-ivory: &ivory + image: registry.highgo.com/ivorysql/ivorysql:5.4-bookworm + environment: &ivoryenv + MODE: pg + IVORYSQL_USER: ivorysql + IVORYSQL_PASSWORD: ivorysql + IVORYSQL_DB: testdb + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ivorysql -d testdb"] + interval: 5s + timeout: 3s + retries: 30 + +services: + ivory-shard0: + <<: *ivory + container_name: ivory-shard0 + ports: ["5443:5432"] + ivory-shard1: + <<: *ivory + container_name: ivory-shard1 + ports: ["5444:5432"] +---- + +== Usage + +=== Starting PgDog + +[source,bash] +---- +./target/release/pgdog --config ./pgdog.toml --users ./users.toml +---- + + +=== Administration Console + +PgDog provides a built-in administration database. The username and password are configured via the `[[admin]]` field in `users.toml`. + +[source,bash] +---- +psql "postgres://admin:pgdog@localhost:6433/admin" +---- + +[source,sql] +---- +-- View client connections and real-time statistics +SHOW CLIENTS + +-- View PostgreSQL connections initiated by PgDog +SHOW SERVERS + +-- View connection pool information +SHOW POOLS + +-- View the configuration currently loaded from pgdog.toml +SHOW CONFIG + +-- View connection pool statistics +SHOW STATS + +-- List of PgDog processes running on the same network. Requires service discovery to be enabled +SHOW PEERS + +-- Reload the configuration from disk. For which options can be changed at runtime, refer to pgdog.toml and users.toml +RELOAD + +-- Recreate all server connections using the existing configuration +RECONNECT + +-- Pause all connection pools. Clients will wait for a connection until the pools resume. Useful for performing a graceful restart of the PostgreSQL server +PAUSE + +-- Resume all connection pools. Clients can acquire connections again +RESUME + +-- List the prepared statements currently in the cache +SHOW PREPARED + +-- List the statements currently in the AST cache used for query routing +SHOW QUERY_CACHE + +-- Pause all queries in order to synchronize configuration changes across multiple PgDog instances +MAINTENANCE + +-- Show the PostgreSQL replication status for each database, including replica lag +SHOW REPLICATION +---- + +=== Connecting to PgDog + +[source,bash] +---- +psql "postgres://ivorysql:ivorysql@localhost:6433/ivory_shard" +---- + +=== Performing Operations + +[TIP] +Make sure the shard backends do not have an `orders` table; PgDog will create it automatically. + +[source,sql] +---- +-- Create the table +CREATE TABLE orders ( + order_id bigint, + customer_id bigint, + amount numeric(10,2), + PRIMARY KEY (order_id, customer_id) +); + +-- Insert data: these rows will be inserted into the two shard backends respectively +-- BUG: the `generate_series` function cannot be used here, because PgDog currently passes this function through transparently +INSERT INTO orders values(1, 1, 1); +INSERT INTO orders values(2, 2, 2); +INSERT INTO orders values(3, 3, 3); +INSERT INTO orders values(4, 4, 4); +INSERT INTO orders values(5, 5, 5); +INSERT INTO orders values(6, 6, 6); +INSERT INTO orders values(7, 7, 7); + +-- Query the data +SELECT * FROM orders; +---- + +=== Connecting to Each Shard Backend to Verify the Data + +[TIP] +Here you will see that the entries in the two shard backends are not evenly distributed. This is because PgDog extracts the value of the `customer_id` field configured in `[[sharded_tables]]` and applies HASH-based sharding to it. + +[source,bash] +---- +# Shard 1 +psql "postgres://ivorysql:ivorysql@localhost:5443/testdb", +# Shard 2 +psql "postgres://ivorysql:ivorysql@localhost:5444/testdb", +---- + +Run the query on each shard backend to verify the data +[source,sql] +---- +SELECT * FROM orders; +---- From c7c152dfa47f407290519d568239cf0644c1d04c Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:23:31 +0800 Subject: [PATCH 03/19] pr-preview.yml add install dependencies --- .github/workflows/pr-preview.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 3a0f238..e6f33e2 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -110,6 +110,12 @@ jobs: run: | echo "Installing Antora packages local..." npm install --global antora@3.1.7 @antora/lunr-extension @antora/pdf-extension @node-rs/jieba + + - name: Install Doc Builder Dependencies + working-directory: ./ivory-doc-builder + run: | + echo "Installing Node dependencies for doc-builder..." + npm install - name: Build English Documentation working-directory: ./ivory-doc-builder From 4bad247338f4ad2709b6b8179adbdccaa5939e06 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:30:46 +0800 Subject: [PATCH 04/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index e6f33e2..be5fc97 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -109,7 +109,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm install --global antora@3.1.7 @antora/lunr-extension @antora/pdf-extension @node-rs/jieba + npm install --global antora@3.1.7 @antora/lunr-extension@3.1.7 @antora/pdf-extension@2.3.x @node-rs/jieba - name: Install Doc Builder Dependencies working-directory: ./ivory-doc-builder From b9c0d5d9675d93cc3eeb5e4a80d22c775f7c51a3 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:33:35 +0800 Subject: [PATCH 05/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index be5fc97..8a239e7 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -109,7 +109,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm install --global antora@3.1.7 @antora/lunr-extension@3.1.7 @antora/pdf-extension@2.3.x @node-rs/jieba + npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.13 @antora/pdf-extension@1.0.0-beta.20 @node-rs/jieba - name: Install Doc Builder Dependencies working-directory: ./ivory-doc-builder From 7ff5033e48c7e809187f68b5449e9624c2133dbf Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:35:39 +0800 Subject: [PATCH 06/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 8a239e7..18a8ddf 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -110,12 +110,6 @@ jobs: run: | echo "Installing Antora packages local..." npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.13 @antora/pdf-extension@1.0.0-beta.20 @node-rs/jieba - - - name: Install Doc Builder Dependencies - working-directory: ./ivory-doc-builder - run: | - echo "Installing Node dependencies for doc-builder..." - npm install - name: Build English Documentation working-directory: ./ivory-doc-builder From 1390665b30bf557075af3d9c68730f0ba550b9ab Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:46:47 +0800 Subject: [PATCH 07/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 18a8ddf..25bca2c 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -109,6 +109,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." + npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.13 @antora/pdf-extension@1.0.0-beta.20 @node-rs/jieba - name: Build English Documentation From 56712802d895cee90eba481aa710fbd58428c494 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:50:18 +0800 Subject: [PATCH 08/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 25bca2c..67ad086 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -110,7 +110,7 @@ jobs: run: | echo "Installing Antora packages local..." npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true - npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.13 @antora/pdf-extension@1.0.0-beta.20 @node-rs/jieba + npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation working-directory: ./ivory-doc-builder From 5b1511927ea362ef3410ffe32ac951738efd5499 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:52:30 +0800 Subject: [PATCH 09/19] pr-preview.yml @antora fixed version --- .github/workflows/merge-build-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-build-push.yml b/.github/workflows/merge-build-push.yml index fb430c3..7f24a4c 100644 --- a/.github/workflows/merge-build-push.yml +++ b/.github/workflows/merge-build-push.yml @@ -188,7 +188,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm install --global antora@3.1.7 @antora/lunr-extension @antora/pdf-extension @node-rs/jieba + npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation working-directory: ./ivory-doc-builder From 685acd9942477d792cd5eb48ae02e86732b9e0c2 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 13:59:33 +0800 Subject: [PATCH 10/19] pr-preview.yml @antora fixed version --- .github/workflows/merge-build-push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/merge-build-push.yml b/.github/workflows/merge-build-push.yml index 7f24a4c..3da3321 100644 --- a/.github/workflows/merge-build-push.yml +++ b/.github/workflows/merge-build-push.yml @@ -188,6 +188,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." + npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation From edfb9c30d7c683c42e6783d77086f131001f63cb Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 14:04:43 +0800 Subject: [PATCH 11/19] pr-preview.yml @antora fixed version --- .github/workflows/merge-build-push.yml | 2 +- .github/workflows/pr-preview.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-build-push.yml b/.github/workflows/merge-build-push.yml index 3da3321..a1bd77f 100644 --- a/.github/workflows/merge-build-push.yml +++ b/.github/workflows/merge-build-push.yml @@ -189,7 +189,7 @@ jobs: run: | echo "Installing Antora packages local..." npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true - npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + npm install --global antora@3.1.15 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation working-directory: ./ivory-doc-builder diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 67ad086..cf9c75f 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -110,7 +110,7 @@ jobs: run: | echo "Installing Antora packages local..." npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true - npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + npm install --global antora@3.1.15 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation working-directory: ./ivory-doc-builder From 0d4b0a997d427dbc22a6250976dbcaf18b507817 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 14:10:15 +0800 Subject: [PATCH 12/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index cf9c75f..fe554f9 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -111,6 +111,7 @@ jobs: echo "Installing Antora packages local..." npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true npm install --global antora@3.1.15 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + npm ls - name: Build English Documentation working-directory: ./ivory-doc-builder From aade4db0bcdf066e1842985a37c15646327c48b8 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 14:16:02 +0800 Subject: [PATCH 13/19] pr-preview.yml @antora fixed version --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index fe554f9..dec7ead 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -1,7 +1,7 @@ name: Pr preview on: - pull_request_target: + pull_request: jobs: build-and-deploy: From 19dce12558fa8f13b4cfb871499c20075933d6ac Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 14:17:59 +0800 Subject: [PATCH 14/19] pr-preview.yml @antora fixed version --- .github/workflows/merge-build-push.yml | 5 ++--- .github/workflows/pr-preview.yml | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/merge-build-push.yml b/.github/workflows/merge-build-push.yml index a1bd77f..f9fb7ac 100644 --- a/.github/workflows/merge-build-push.yml +++ b/.github/workflows/merge-build-push.yml @@ -1,7 +1,7 @@ name: Build , Push to web, Deploy Antora Docs on: - pull_request_target: + pull_request: types: - closed create: @@ -188,8 +188,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true - npm install --global antora@3.1.15 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation working-directory: ./ivory-doc-builder diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index dec7ead..f125e3b 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -109,9 +109,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm uninstall -g antora @antora/pdf-extension @antora/site-generator @antora/assembler || true - npm install --global antora@3.1.15 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - npm ls + npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - name: Build English Documentation working-directory: ./ivory-doc-builder From 7ddc4f9171fd6bafbfde03d8af3275737385ad37 Mon Sep 17 00:00:00 2001 From: Lanchitour Date: Tue, 30 Jun 2026 14:22:47 +0800 Subject: [PATCH 15/19] Create test_antora.yml --- .github/workflows/test_antora.yml | 168 ++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 .github/workflows/test_antora.yml diff --git a/.github/workflows/test_antora.yml b/.github/workflows/test_antora.yml new file mode 100644 index 0000000..f125e3b --- /dev/null +++ b/.github/workflows/test_antora.yml @@ -0,0 +1,168 @@ +name: Pr preview + +on: + pull_request: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + deployments: write + statuses: write + + steps: + - name: Checkout Documentation Repository (ivorysql_doc) + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + path: ivorysql_doc + + - name: Fetch All Relevant Branches into Local Docs Repo + working-directory: ./ivorysql_doc + run: | + echo "Fetching all branches from origin to update local remote-tracking branches..." + git fetch origin --prune --no-tags + + echo "--- Fetched Remote-Tracking Branches ---" + git branch -r + + - name: Checkout Doc Builder Repository (doc_builder) + uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/ivory-doc-builder + path: ivory-doc-builder + + - name: Install yq + run: | + sudo apt-get update -y + sudo apt-get install -y jq + sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq + sudo chmod +x /usr/bin/yq + yq --version + + - name: Modify Antora Playbooks for Local PR Build + working-directory: ./ivory-doc-builder + env: + DETECTED_VERSION: 'master' + START_PAGE_COMPONENT_NAME: "ivorysql-doc" + START_PAGE_FILE_PATH: "welcome.adoc" + run: | + PLAYBOOK_FILES=("antora-playbook-CN.yml" "antora-playbook-EN.yml") + NEW_LOCAL_URL="../ivorysql_doc" + + for PLAYBOOK_FILE in "${PLAYBOOK_FILES[@]}"; do + if [ -f "$PLAYBOOK_FILE" ]; then + echo "--- Modifying Playbook: $PLAYBOOK_FILE ---" + echo "Original content of $PLAYBOOK_FILE:" + cat "$PLAYBOOK_FILE" + echo # Newline for better readability + + yq -i ".content.sources[0].url = \"$NEW_LOCAL_URL\"" "$PLAYBOOK_FILE" + + yq -i ".ui.bundle.url = \"./entemplates.zip\"" "$PLAYBOOK_FILE" + + yq -i ".content.sources[0].branches = [\"HEAD\"]" "$PLAYBOOK_FILE" + + yq -i ".content.sources[0].edit_url = false" "$PLAYBOOK_FILE" + if [[ -n "$DETECTED_VERSION" ]]; then + NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}::${DETECTED_VERSION}/${START_PAGE_FILE_PATH}" + yq -i ".site.start_page = \"$NEW_START_PAGE\"" "$PLAYBOOK_FILE" + echo "Updated .site.start_page in $PLAYBOOK_FILE to: $NEW_START_PAGE" + else + echo "WARNING: DETECTED_VERSION is empty. Skipping start_page update for $PLAYBOOK_FILE." + fi + yq -i ".site.title = .site.title + \" (PR Preview)\"" "$PLAYBOOK_FILE" + echo "Modified content of $PLAYBOOK_FILE:" + cat "$PLAYBOOK_FILE" + echo "--- Finished modification for $PLAYBOOK_FILE ---" + echo # Newline + else + echo "WARNING: Playbook file $PLAYBOOK_FILE not found in $(pwd)." + fi + done + + - name: Checkout WWW Repository (www) + uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/ivorysql_web + path: www_publish_target + + - name: Setup Ruby and Bundler + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + + - name: Install Asciidoctor PDF and related Gems + run: | + echo "Installing Asciidoctor PDF gems..." + gem install asciidoctor-pdf --version "~>2.3.19" + gem install rouge + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.15' + + - name: Install Antora CLI + run: | + echo "Installing Antora packages local..." + npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + + - name: Build English Documentation + working-directory: ./ivory-doc-builder + run: | + echo "Current directory: $(pwd)" + echo "Building English site..." + #mkdir -p ../www_publish_target/docs/en + npx antora generate --stacktrace --to-dir ../www_publish_target/docs/en antora-playbook-EN.yml + + - name: Build Chinese Documentation + working-directory: ./ivory-doc-builder + run: | + echo "Building Chinese site..." + #mkdir -p ../www_publish_target/docs/cn + npx antora generate --stacktrace --to-dir ../www_publish_target/docs/cn antora-playbook-CN.yml + + - name: Deploy to Netlify + id: netlify_deploy + uses: nwtgck/actions-netlify@v3.0 + with: + publish-dir: './www_publish_target/docs' + production-branch: test + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy preview for PR #${{ github.event.number }}" + enable-pull-request-comment: false + enable-commit-comment: false + enable-commit-status: true + alias: pr-${{ github.event.number }}-doc + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 5 + + - name: Post Custom Preview Links Comment + if: steps.netlify_deploy.outputs.deploy-url + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const baseUrl = '${{ steps.netlify_deploy.outputs.deploy-url }}'; + + const enUrl = `${baseUrl}/en`; + + const body = ` + 🚀 **IvorySQL-Docs Preview Ready** + + - **Chinese Preview:** [${baseUrl}](${baseUrl}) + - **English Preview:** [${enUrl}](${enUrl}) + `; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: body + }); From 4348c8461c449155746956d2dac6866a156e92e0 Mon Sep 17 00:00:00 2001 From: Lanchitour Date: Tue, 30 Jun 2026 14:25:18 +0800 Subject: [PATCH 16/19] Update test_antora.yml --- .github/workflows/test_antora.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test_antora.yml b/.github/workflows/test_antora.yml index f125e3b..abec88b 100644 --- a/.github/workflows/test_antora.yml +++ b/.github/workflows/test_antora.yml @@ -132,22 +132,17 @@ jobs: with: publish-dir: './www_publish_target/docs' production-branch: test - github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: "Deploy preview for PR #${{ github.event.number }}" enable-pull-request-comment: false enable-commit-comment: false enable-commit-status: true alias: pr-${{ github.event.number }}-doc - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} timeout-minutes: 5 - name: Post Custom Preview Links Comment if: steps.netlify_deploy.outputs.deploy-url uses: actions/github-script@v7 with: - github-token: ${{ secrets.GITHUB_TOKEN }} script: | const baseUrl = '${{ steps.netlify_deploy.outputs.deploy-url }}'; From 8d20bc522189b1cc7e97777bb14b0cb96c1f4646 Mon Sep 17 00:00:00 2001 From: Lanchitour Date: Tue, 30 Jun 2026 14:29:00 +0800 Subject: [PATCH 17/19] Update test_antora.yml --- .github/workflows/test_antora.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_antora.yml b/.github/workflows/test_antora.yml index abec88b..bfb039c 100644 --- a/.github/workflows/test_antora.yml +++ b/.github/workflows/test_antora.yml @@ -1,7 +1,12 @@ -name: Pr preview +name: Test on: - pull_request: + workflow_dispatch: + inputs: + source_branch: + description: '要构建的文档分支,比如 v4.5' + required: false + default: '' jobs: build-and-deploy: From 9657a63d9ec49f84f43edaf530303e7587a2fb59 Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 14:43:51 +0800 Subject: [PATCH 18/19] update --- .github/workflows/merge-build-push.yml | 4 ++-- .github/workflows/pr-preview.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/merge-build-push.yml b/.github/workflows/merge-build-push.yml index f9fb7ac..fb430c3 100644 --- a/.github/workflows/merge-build-push.yml +++ b/.github/workflows/merge-build-push.yml @@ -1,7 +1,7 @@ name: Build , Push to web, Deploy Antora Docs on: - pull_request: + pull_request_target: types: - closed create: @@ -188,7 +188,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + npm install --global antora@3.1.7 @antora/lunr-extension @antora/pdf-extension @node-rs/jieba - name: Build English Documentation working-directory: ./ivory-doc-builder diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index f125e3b..3a0f238 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -1,7 +1,7 @@ name: Pr preview on: - pull_request: + pull_request_target: jobs: build-and-deploy: @@ -109,7 +109,7 @@ jobs: - name: Install Antora CLI run: | echo "Installing Antora packages local..." - npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 + npm install --global antora@3.1.7 @antora/lunr-extension @antora/pdf-extension @node-rs/jieba - name: Build English Documentation working-directory: ./ivory-doc-builder From 828797bec2b5635c511445e4623c1542dc5a6eff Mon Sep 17 00:00:00 2001 From: hanjianqiao Date: Tue, 30 Jun 2026 14:46:58 +0800 Subject: [PATCH 19/19] trigger ci --- .github/workflows/test_antora.yml | 168 ------------------------------ 1 file changed, 168 deletions(-) delete mode 100644 .github/workflows/test_antora.yml diff --git a/.github/workflows/test_antora.yml b/.github/workflows/test_antora.yml deleted file mode 100644 index bfb039c..0000000 --- a/.github/workflows/test_antora.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: Test - -on: - workflow_dispatch: - inputs: - source_branch: - description: '要构建的文档分支,比如 v4.5' - required: false - default: '' - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - deployments: write - statuses: write - - steps: - - name: Checkout Documentation Repository (ivorysql_doc) - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - path: ivorysql_doc - - - name: Fetch All Relevant Branches into Local Docs Repo - working-directory: ./ivorysql_doc - run: | - echo "Fetching all branches from origin to update local remote-tracking branches..." - git fetch origin --prune --no-tags - - echo "--- Fetched Remote-Tracking Branches ---" - git branch -r - - - name: Checkout Doc Builder Repository (doc_builder) - uses: actions/checkout@v4 - with: - repository: ${{ github.repository_owner }}/ivory-doc-builder - path: ivory-doc-builder - - - name: Install yq - run: | - sudo apt-get update -y - sudo apt-get install -y jq - sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq - sudo chmod +x /usr/bin/yq - yq --version - - - name: Modify Antora Playbooks for Local PR Build - working-directory: ./ivory-doc-builder - env: - DETECTED_VERSION: 'master' - START_PAGE_COMPONENT_NAME: "ivorysql-doc" - START_PAGE_FILE_PATH: "welcome.adoc" - run: | - PLAYBOOK_FILES=("antora-playbook-CN.yml" "antora-playbook-EN.yml") - NEW_LOCAL_URL="../ivorysql_doc" - - for PLAYBOOK_FILE in "${PLAYBOOK_FILES[@]}"; do - if [ -f "$PLAYBOOK_FILE" ]; then - echo "--- Modifying Playbook: $PLAYBOOK_FILE ---" - echo "Original content of $PLAYBOOK_FILE:" - cat "$PLAYBOOK_FILE" - echo # Newline for better readability - - yq -i ".content.sources[0].url = \"$NEW_LOCAL_URL\"" "$PLAYBOOK_FILE" - - yq -i ".ui.bundle.url = \"./entemplates.zip\"" "$PLAYBOOK_FILE" - - yq -i ".content.sources[0].branches = [\"HEAD\"]" "$PLAYBOOK_FILE" - - yq -i ".content.sources[0].edit_url = false" "$PLAYBOOK_FILE" - if [[ -n "$DETECTED_VERSION" ]]; then - NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}::${DETECTED_VERSION}/${START_PAGE_FILE_PATH}" - yq -i ".site.start_page = \"$NEW_START_PAGE\"" "$PLAYBOOK_FILE" - echo "Updated .site.start_page in $PLAYBOOK_FILE to: $NEW_START_PAGE" - else - echo "WARNING: DETECTED_VERSION is empty. Skipping start_page update for $PLAYBOOK_FILE." - fi - yq -i ".site.title = .site.title + \" (PR Preview)\"" "$PLAYBOOK_FILE" - echo "Modified content of $PLAYBOOK_FILE:" - cat "$PLAYBOOK_FILE" - echo "--- Finished modification for $PLAYBOOK_FILE ---" - echo # Newline - else - echo "WARNING: Playbook file $PLAYBOOK_FILE not found in $(pwd)." - fi - done - - - name: Checkout WWW Repository (www) - uses: actions/checkout@v4 - with: - repository: ${{ github.repository_owner }}/ivorysql_web - path: www_publish_target - - - name: Setup Ruby and Bundler - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0' - - - name: Install Asciidoctor PDF and related Gems - run: | - echo "Installing Asciidoctor PDF gems..." - gem install asciidoctor-pdf --version "~>2.3.19" - gem install rouge - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22.15' - - - name: Install Antora CLI - run: | - echo "Installing Antora packages local..." - npm install --global antora@3.1.7 @antora/lunr-extension@1.0.0-alpha.11 @antora/pdf-extension@1.0.0-alpha.20 @node-rs/jieba@1.10.3 - - - name: Build English Documentation - working-directory: ./ivory-doc-builder - run: | - echo "Current directory: $(pwd)" - echo "Building English site..." - #mkdir -p ../www_publish_target/docs/en - npx antora generate --stacktrace --to-dir ../www_publish_target/docs/en antora-playbook-EN.yml - - - name: Build Chinese Documentation - working-directory: ./ivory-doc-builder - run: | - echo "Building Chinese site..." - #mkdir -p ../www_publish_target/docs/cn - npx antora generate --stacktrace --to-dir ../www_publish_target/docs/cn antora-playbook-CN.yml - - - name: Deploy to Netlify - id: netlify_deploy - uses: nwtgck/actions-netlify@v3.0 - with: - publish-dir: './www_publish_target/docs' - production-branch: test - deploy-message: "Deploy preview for PR #${{ github.event.number }}" - enable-pull-request-comment: false - enable-commit-comment: false - enable-commit-status: true - alias: pr-${{ github.event.number }}-doc - timeout-minutes: 5 - - - name: Post Custom Preview Links Comment - if: steps.netlify_deploy.outputs.deploy-url - uses: actions/github-script@v7 - with: - script: | - const baseUrl = '${{ steps.netlify_deploy.outputs.deploy-url }}'; - - const enUrl = `${baseUrl}/en`; - - const body = ` - 🚀 **IvorySQL-Docs Preview Ready** - - - **Chinese Preview:** [${baseUrl}](${baseUrl}) - - **English Preview:** [${enUrl}](${enUrl}) - `; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: body - });