action
This commit is contained in:
37
.gitea/workflows/deploy.yaml
Normal file
37
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Deploy WebSocket Server
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # 或者是 master,请根据您的分支名称修改
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu # 或者您的 Gitea runner 标签
|
||||
steps:
|
||||
- name: SSH Remote Commands
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: ${{ secrets.SERVER_USERNAME }}
|
||||
password: ${{ secrets.SERVER_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
# 进入项目目录
|
||||
cd /root/V2_micropython/
|
||||
|
||||
# 拉取最新代码
|
||||
echo "Pulling latest code..."
|
||||
git pull
|
||||
|
||||
# 进入 websocket_server 目录
|
||||
cd websocket_server
|
||||
|
||||
# 重启服务
|
||||
echo "Restarting Docker Compose services..."
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
|
||||
# 检查部署状态
|
||||
echo "Checking deployment status..."
|
||||
docker compose ps
|
||||
Reference in New Issue
Block a user