change gitea yaml

This commit is contained in:
2026-03-15 01:09:17 +08:00
parent 7da3dcba72
commit 83e3374cd6

View File

@@ -3,13 +3,23 @@ on:
push: push:
branches: branches:
- main - main
jobs: jobs:
redeploy: redeploy:
runs-on: ubuntu-latest runs-on: self-hosted # 使用 self-hosted 標籤通常比較明確
steps: steps:
- name: Deploy - name: Deploy
run: | run: |
# 進入專案資料夾
cd /home/ubuntu/apps/linebot_finance || exit 1
# 解決目錄權限爭議
git config --global --add safe.directory /home/ubuntu/apps/linebot_finance 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