diff --git a/.gitea/workflows/deploy-prod.yml b/.gitea/workflows/deploy-prod.yml index 0e26066..75b0464 100644 --- a/.gitea/workflows/deploy-prod.yml +++ b/.gitea/workflows/deploy-prod.yml @@ -13,6 +13,18 @@ on: description: '确认部署拼豆到生产环境? 输入 yes' required: true default: 'no' + cleanup_host: + description: '清理目标host(默认测试机; A/B定稿前勿改)' + required: false + default: '156.233.226.86' + cleanup_port: + description: '清理目标SSH端口' + required: false + default: '48222' + cleanup_user: + description: '清理目标用户' + required: false + default: 'root' jobs: deploy-prod: @@ -51,7 +63,7 @@ jobs: -e DATABASE_URL='postgres://pgsql:XGYnJPysCNJsLeea@postgres:5432/perler_lab' \ -e JWT_SECRET='ab0538194ce36bdb85afc22e608e5b548bc5717d4e5f7cda917701ef2c53bca6' \ -e TAC_ENABLED="true" \ - -e TAC_API_BASE="http://10.9.0.2:18200" \ + -e TAC_API_BASE="http://10.9.0.5:18200" \ -e TAC_SITE_KEY="6796bad8-4369-492f-a4d7-643a93bb07f3" \ -e TAC_SECRET_KEY="dae2c135-4e61-4249-a5bb-a15081b1a2b6" \ -p 8788:8788 \ @@ -61,7 +73,7 @@ jobs: docker run -d --name perler-lab-frontend \ --restart unless-stopped \ --network perler-net \ - -e CAPTCHA_UPSTREAM="10.9.0.2:18200" \ + -e CAPTCHA_UPSTREAM="10.9.0.5:18200" \ -p 8080:80 \ perler-lab-frontend:latest echo '容器已启动,等待健康检查...' @@ -79,7 +91,7 @@ jobs: # 版本已上生产,清理 test2 环境对应版本(新规则) - name: Cleanup test2 env (version now in production) run: | - ssh -o StrictHostKeyChecking=no -p 47222 root@171.80.10.85 " + ssh -o StrictHostKeyChecking=no -p ${{ inputs.cleanup_port }} ${{ inputs.cleanup_user }}@${{ inputs.cleanup_host }} " docker stop perler-lab-server perler-lab-frontend 2>/dev/null && docker rm perler-lab-server perler-lab-frontend 2>/dev/null && echo '? test1 容器已清理(版本已上生产)' || echo '?? test1 清理失败或已不存在' " continue-on-error: true \ No newline at end of file