Files
ESP32_GDEY042T81_server/.gitea/workflows/deploy.yaml
jeremygan2021 a1e8c042ca
Some checks failed
Deploy to Server / deploy (push) Has been cancelled
action
2026-03-02 13:01:04 +08:00

46 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Deploy to Server
on:
push:
branches:
- main
- master
jobs:
deploy:
runs-on: ubuntu
steps:
- name: Checkout
uses: actions/checkout@v3
# 建议在 Gitea 仓库设置中配置 Secrets而不是直接写在文件中
# SERVER_HOST, SERVER_USER, SERVER_PASSWORD
- name: Copy files to server
uses: appleboy/scp-action@v0.1.7
with:
host: "6.6.6.66"
username: "quant-speed"
password: "123quant-speed"
source: "."
target: "/home/quant-speed/luna2025"
# 排除不需要上传的文件
exclude: ".git,.github,.gitea,.trae,__pycache__,*.pyc,*.pyo,*.pyd,.DS_Store"
- name: Deploy on server
uses: appleboy/ssh-action@v1.0.3
with:
host: "6.6.6.66"
username: "quant-speed"
password: "123quant-speed"
script: |
# 进入项目目录
cd /home/quant-speed/luna2025
# 停止容器并删除同名镜像
# --rmi local: 删除服务构建的镜像
echo "123quant-speed" | sudo -S docker compose down --rmi local
echo "123quant-speed" | sudo -S docker rmi epaper_server:latest || true
# 启动服务
echo "123quant-speed" | sudo -S docker compose up -d --build