From 67b2084b82e00997ed5a3f345c054daf380eeb56 Mon Sep 17 00:00:00 2001
From: maninhill <41712985+maninhill@users.noreply.github.com>
Date: Wed, 30 Jul 2025 10:59:25 +0800
Subject: [PATCH 1/5] chore: Update README.md
---
README.md | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/README.md b/README.md
index 50f12613..a412ecba 100644
--- a/README.md
+++ b/README.md
@@ -8,13 +8,7 @@
-SQLBot 是一款基于大模型和 RAG 的智能问数系统。
-
-SQLBot 的工作原理:
-
-TBD
-
-SQLBot 的优势包括:
+SQLBot 是一款基于大模型和 RAG 的智能问数系统。SQLBot 的优势包括:
- **开箱即用**: 只需配置大模型和数据源即可开启问数之旅,通过大模型和 RAG 的结合来实现高质量的 text2sql;
- **易于集成**: 支持快速嵌入到第三方业务系统,也支持被 n8n、MaxKB、Dify 、Coze 等 AI 应用开发平台集成调用,让各类应用快速拥有智能问数能力;
@@ -50,12 +44,6 @@ TBD
-## 技术栈
-
-- Frontend:[Vue.js](https://vuejs.org/)
-- Backend:[Python / Django](https://www.djangoproject.com/)
-- Database:[PostgreSQL + pgvector](https://www.postgresql.org/)
-
## 飞致云的其他明星项目
- [DataEase](https://github.com/dataease/dataease/) - 人人可用的开源 BI 工具
From e44fb84c26c44a3aee0e1c44ab128beb28ef4b8e Mon Sep 17 00:00:00 2001
From: xuwei-fit2cloud
Date: Wed, 30 Jul 2025 11:07:28 +0800
Subject: [PATCH 2/5] refactor: add build_and_push github action
---
.github/workflows/build_and_push.yml | 108 +++++++++++++++++++++++++++
.github/workflows/build_docker.yml | 56 --------------
2 files changed, 108 insertions(+), 56 deletions(-)
create mode 100644 .github/workflows/build_and_push.yml
delete mode 100644 .github/workflows/build_docker.yml
diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml
new file mode 100644
index 00000000..09308731
--- /dev/null
+++ b/.github/workflows/build_and_push.yml
@@ -0,0 +1,108 @@
+name: build-and-push
+
+run-name: 构建镜像并推送仓库 ${{ github.event.inputs.dockerImageTag }} (${{ github.event.inputs.registry }}) (${{ github.event.inputs.architecture }})
+
+on:
+ workflow_dispatch:
+ inputs:
+ branch:
+ description: 'Branch'
+ required: true
+ default: "main"
+ dockerImageTag:
+ description: 'Image Tag'
+ default: 'v0.9.0'
+ required: true
+ dockerImageTagWithLatest:
+ description: '是否发布latest tag(正式发版时选择,测试版本切勿选择)'
+ default: false
+ required: true
+ type: boolean
+ architecture:
+ description: 'Architecture'
+ required: true
+ default: 'linux/amd64'
+ type: choice
+ options:
+ - linux/amd64
+ - linux/arm64
+ - linux/amd64,linux/arm64
+ registry:
+ description: 'Push To Registry'
+ required: true
+ default: 'aliyun-registry'
+ type: choice
+ options:
+ - aliyun-registry
+ - dockerhub
+ - dockerhub, aliyun-registry
+
+jobs:
+ build-and-push-to-aliyun-registry:
+ if: ${{ contains(github.event.inputs.registry, 'aliyun') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.inputs.branch }}
+ - name: Prepare
+ id: prepare
+ run: |
+ DOCKER_IMAGE=${{ secrets.ALIYUN_REGISTRY_HOST }}/maxkb/maxkb
+ DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
+ TAG_NAME=${{ github.event.inputs.dockerImageTag }}
+ TAG_NAME_WITH_LATEST=${{ github.event.inputs.dockerImageTagWithLatest }}
+ if [[ ${TAG_NAME_WITH_LATEST} == 'true' ]]; then
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:${TAG_NAME%%.*} --tag ${DOCKER_IMAGE}:latest"
+ else
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME}"
+ fi
+ echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --memory-swap -1 \
+ --build-arg DOCKER_IMAGE_TAG=${{ github.event.inputs.dockerImageTag }} --build-arg BUILD_AT=$(TZ=Asia/Shanghai date +'%Y-%m-%dT%H:%M') --build-arg GITHUB_COMMIT=`git rev-parse --short HEAD` --no-cache \
+ ${DOCKER_IMAGE_TAGS} .
+ - name: Set up Docker Buildx
+ uses: crazy-max/ghaction-docker-buildx@v3
+ - name: Login to Aliyun Registry
+ uses: docker/login-action@v2
+ with:
+ registry: registry.cn-qingdao.aliyuncs.com
+ username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
+ password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
+ - name: Docker Buildx (build-and-push)
+ run: |
+ docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
+
+ build-and-push-to-dockerhub:
+ if: ${{ contains(github.event.inputs.registry, 'dockerhub') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.inputs.branch }}
+ - name: Prepare
+ id: prepare
+ run: |
+ DOCKER_IMAGE=dataease/sqlbot
+ DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
+ TAG_NAME=${{ github.event.inputs.dockerImageTag }}
+ TAG_NAME_WITH_LATEST=${{ github.event.inputs.dockerImageTagWithLatest }}
+ if [[ ${TAG_NAME_WITH_LATEST} == 'true' ]]; then
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:${TAG_NAME%%.*} --tag ${DOCKER_IMAGE}:latest"
+ else
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME}"
+ fi
+ echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --memory-swap -1 \
+ --build-arg DOCKER_IMAGE_TAG=${{ github.event.inputs.dockerImageTag }} --build-arg BUILD_AT=$(TZ=Asia/Shanghai date +'%Y-%m-%dT%H:%M') --build-arg GITHUB_COMMIT=`git rev-parse --short HEAD` --no-cache \
+ ${DOCKER_IMAGE_TAGS} .
+ - name: Set up Docker Buildx
+ uses: crazy-max/ghaction-docker-buildx@v3
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Docker Buildx (build-and-push)
+ run: |
+ docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
\ No newline at end of file
diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml
deleted file mode 100644
index 6d0b12d2..00000000
--- a/.github/workflows/build_docker.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
-
-name: build_docker CI
-
-on:
- workflow_dispatch:
- inputs:
- image_version:
- description: 'The version of the Docker image'
- required: true
- default: 'dev'
- #push:
- #branches: [ "main" ]
- #pull_request:
- #branches: [ "main" ]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- node-version: [22.x]
- # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
-
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node-version }}
- - name: Install and build
- working-directory: ./frontend
- run: |
- npm install
- npm run build
- - name: Copy dist to backend
- run: |
- cp -r frontend/dist backend/
- - name: Login to Docker
- uses: docker/login-action@v2
- with:
- registry: ${{ secrets.DOCKERHUB_REGISTRY }}
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Build and push Docker image
- uses: docker/build-push-action@v4
- with:
- context: .
- push: true
- tags: |
- ${{ secrets.DOCKERHUB_REGISTRY }}/dataease-v2/sqlbot:latest
- ${{ secrets.DOCKERHUB_REGISTRY }}/dataease-v2/sqlbot:${{ inputs.image_version }}
-
From 81a31c1655d3d44a0fb14b277dbb102fe471bfc2 Mon Sep 17 00:00:00 2001
From: xuwei-fit2cloud
Date: Wed, 30 Jul 2025 11:11:01 +0800
Subject: [PATCH 3/5] fix: docker registry url
---
.github/workflows/build_and_push.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml
index 09308731..81a22940 100644
--- a/.github/workflows/build_and_push.yml
+++ b/.github/workflows/build_and_push.yml
@@ -49,7 +49,7 @@ jobs:
- name: Prepare
id: prepare
run: |
- DOCKER_IMAGE=${{ secrets.ALIYUN_REGISTRY_HOST }}/maxkb/maxkb
+ DOCKER_IMAGE=${{ secrets.ALIYUN_REGISTRY_HOST }}/dataease/sqlbot
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
TAG_NAME_WITH_LATEST=${{ github.event.inputs.dockerImageTagWithLatest }}
From 383abc1ee1c6c8bf61e9957ccd4a861e6215c7db Mon Sep 17 00:00:00 2001
From: xuwei-fit2cloud
Date: Wed, 30 Jul 2025 11:14:31 +0800
Subject: [PATCH 4/5] refactor: replace value with param
---
.github/workflows/build_and_push.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml
index 81a22940..74f0a5d4 100644
--- a/.github/workflows/build_and_push.yml
+++ b/.github/workflows/build_and_push.yml
@@ -66,7 +66,7 @@ jobs:
- name: Login to Aliyun Registry
uses: docker/login-action@v2
with:
- registry: registry.cn-qingdao.aliyuncs.com
+ registry: ${{ secrets.ALIYUN_REGISTRY_HOST }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Docker Buildx (build-and-push)
From 0fe40f42b0a42c36123abe9e951e5dbce22447cf Mon Sep 17 00:00:00 2001
From: xuwei-fit2cloud
Date: Wed, 30 Jul 2025 11:17:58 +0800
Subject: [PATCH 5/5] refactor: update action ref_name
---
.github/workflows/build_and_push.yml | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml
index 74f0a5d4..0c95c539 100644
--- a/.github/workflows/build_and_push.yml
+++ b/.github/workflows/build_and_push.yml
@@ -5,10 +5,6 @@ run-name: 构建镜像并推送仓库 ${{ github.event.inputs.dockerImageTag }}
on:
workflow_dispatch:
inputs:
- branch:
- description: 'Branch'
- required: true
- default: "main"
dockerImageTag:
description: 'Image Tag'
default: 'v0.9.0'
@@ -45,7 +41,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
- ref: ${{ github.event.inputs.branch }}
+ ref: ${{ github.ref_name }}
- name: Prepare
id: prepare
run: |
@@ -80,7 +76,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
- ref: ${{ github.event.inputs.branch }}
+ ref: ${{ github.ref_name }}
- name: Prepare
id: prepare
run: |