Some checks failed
Deploy to Production / deploy (push) Has been cancelled
- Add Dockerfile for multi-stage build - Add docker-compose.yml for easy deployment - Add Gitea Actions CI/CD workflow - Add deployment script (deploy.sh) - Add nginx and supervisord configuration - Add deployment documentation Deployment target: 192.168.9.149:8080 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.0 KiB
YAML
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: 192.168.9.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
|
|
|
|
# 停止并删除旧容器
|
|
docker-compose down
|
|
|
|
# 构建并启动新容器
|
|
docker-compose up -d --build
|
|
|
|
# 清理旧镜像
|
|
docker image prune -f
|
|
|
|
# 显示容器状态
|
|
docker-compose ps
|