From 8a6378606484afc8407a6e2c4809720d1c828109 Mon Sep 17 00:00:00 2001 From: kurihada Date: Mon, 1 Jun 2026 16:35:25 +0800 Subject: [PATCH] Add Gitea Actions workflow (migrated from Jenkins) --- .gitea/workflows/deploy.yml | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..b94894b --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,81 @@ +name: Build and Deploy + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + container: + options: -v /var/run/docker.sock:/var/run/docker.sock + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install pnpm + run: npm install -g pnpm + + - name: Build XHS Docker image + run: | + docker build \ + --build-arg APP_NAME=xhs-mcp \ + -t social-mcp-xhs:latest \ + -t social-mcp-xhs:${{ github.sha }} \ + . + + - name: Build XHH Docker image + run: | + docker build \ + --build-arg APP_NAME=xhh-mcp \ + -t social-mcp-xhh:latest \ + -t social-mcp-xhh:${{ github.sha }} \ + . + + - name: Deploy + run: | + docker stop mcp-xhs || true + docker rm mcp-xhs || true + docker stop mcp-xhh || true + docker rm mcp-xhh || true + mkdir -p /data/mcp-xhs /data/mcp-xhh + chown 1001:1001 /data/mcp-xhs /data/mcp-xhh + + docker run -d \ + --name mcp-xhs \ + --network nginx \ + -p 9527:9527 \ + --shm-size=1g \ + -v /data/mcp-xhs:/home/appuser/.social-mcp-xhs \ + -e NODE_ENV=production \ + -e HOST=0.0.0.0 \ + -e PORT=9527 \ + -e HEADLESS=true \ + -e COOKIE_DIR=/home/appuser/.social-mcp-xhs \ + -e APP_NAME=xhs-mcp \ + -e ALLOW_REMOTE=yes-i-understand-the-risk \ + --restart unless-stopped \ + social-mcp-xhs:latest + + docker run -d \ + --name mcp-xhh \ + --network nginx \ + -p 9528:9528 \ + --shm-size=1g \ + -v /data/mcp-xhh:/home/appuser/.social-mcp-xhh \ + -e NODE_ENV=production \ + -e HOST=0.0.0.0 \ + -e PORT=9528 \ + -e HEADLESS=true \ + -e COOKIE_DIR=/home/appuser/.social-mcp-xhh \ + -e APP_NAME=xhh-mcp \ + -e ALLOW_REMOTE=yes-i-understand-the-risk \ + --restart unless-stopped \ + social-mcp-xhh:latest