Files
kt-financial-system/.gitea/workflows/deploy.yml
你的用户名 88020fe283
Some checks failed
Deploy to Production / deploy (push) Has been cancelled
修复Docker权限问题,使用sudo执行docker命令
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 17:24:01 +08:00

47 lines
1.0 KiB
YAML

name: Deploy to Production
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.0
with:
host: 172.16.74.149
username: atai
password: wengewudi666808
port: 22
script: |
cd /home/atai/kt-financial-system
# 如果目录不存在,克隆仓库
if [ ! -d ".git" ]; then
cd /home/atai
git clone https://gitea.ktyun.cc/chenjiangjiang/kt-financial-system.git
cd kt-financial-system
fi
# 拉取最新代码
git pull origin main
# 停止并删除旧容器
sudo docker-compose down
# 构建并启动新容器
sudo docker-compose up -d --build
# 清理旧镜像
sudo docker image prune -f
# 显示容器状态
sudo docker-compose ps