mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
change gitea yaml
This commit is contained in:
@@ -3,13 +3,23 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
redeploy:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted # 使用 self-hosted 標籤通常比較明確
|
||||
steps:
|
||||
- name: Deploy
|
||||
run: |
|
||||
# 進入專案資料夾
|
||||
cd /home/ubuntu/apps/linebot_finance || exit 1
|
||||
|
||||
# 解決目錄權限爭議
|
||||
git config --global --add safe.directory /home/ubuntu/apps/linebot_finance
|
||||
cd /home/ubuntu/apps/linebot_finance
|
||||
git pull
|
||||
docker compose up -d
|
||||
|
||||
# 更新程式碼
|
||||
git fetch --all
|
||||
git reset --hard origin/main
|
||||
|
||||
# 重啟 Docker 容器
|
||||
# 建議加上 --build 確保 Python/PHP 程式碼變動有被更新進 image
|
||||
docker compose up -d --build
|
||||
Reference in New Issue
Block a user