fix: using mcp.run to pass sse_path, messages_path #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: at-mcp-server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'version.txt' | |
| jobs: | |
| pypi-pkg: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| # Read version from version.txt file | |
| - name: Get the version | |
| id: get_version | |
| run: | | |
| echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV | |
| - name: Update version in pyproject.toml | |
| run: | | |
| sed -i "s/version = \".*\"/version = \"${{ env.VERSION }}\"/" pyproject.toml | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| python -m twine upload dist/* | |
| docker-image: | |
| runs-on: ubuntu-latest | |
| needs: pypi-pkg | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Aliyun Docker Registry | |
| run: echo ${{ secrets.ALIYUN_DOCKER_REGISTRY_PASSWORD }} | docker login --username=${{ secrets.ALIYUN_DOCKER_REGISTRY_USER }} --password-stdin registry.cn-shanghai.aliyuncs.com | |
| # Read version from version.txt file and set date | |
| - name: Get the version and date | |
| id: get_version | |
| run: | | |
| echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV | |
| - name: Build, tag and push Docker image with cache | |
| uses: docker/build-push-action@v5.0.0 | |
| with: | |
| context: . # 使用at-web目录作为上下文 | |
| file: Dockerfile # Dockerfile的位置 | |
| push: true # 推送镜像到阿里云镜像仓库 | |
| tags: | | |
| registry.cn-shanghai.aliyuncs.com/datamini/asktable-mcp-server:${{ env.VERSION }} | |
| registry.cn-shanghai.aliyuncs.com/datamini/asktable-mcp-server:latest | |
| platforms: linux/amd64 | |
| # platforms: linux/amd64, linux/arm64 | |
| deploy-to-saas: | |
| runs-on: ubuntu-latest | |
| needs: docker-image | |
| steps: | |
| - name: Deploy to production server | |
| uses: appleboy/ssh-action@v0.1.10 | |
| with: | |
| host: ${{ secrets.SERVER_HOST_SH3 }} | |
| username: ${{ secrets.SERVER_USER }} | |
| password: ${{ secrets.SERVER_PASSWORD }} | |
| port: 22 | |
| script: | | |
| # 进入部署目录 | |
| cd /root/sh3/at-mcp-server | |
| # 拉取最新镜像 | |
| docker compose pull && docker compose down | |
| # 启动容器 | |
| docker compose up -d |