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:
@@ -6,18 +6,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
redeploy:
|
redeploy:
|
||||||
runs-on: host # 注意:這裡改成你剛設定的標籤 host
|
runs-on: host # 必須對應你註冊時填寫的 Label
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy
|
- name: Sync and Deploy
|
||||||
run: |
|
run: |
|
||||||
# 這次它真的看得到這些資料夾了!
|
echo "Current user: $(whoami)"
|
||||||
cd /home/ubuntu/apps/linebot_finance
|
echo "Deployment started at: $(date)"
|
||||||
|
|
||||||
# 同步程式碼 (走你之前成功的本地路徑)
|
# 1. 進入專案目錄
|
||||||
|
cd /home/ubuntu/apps/linebot_finance || exit 1
|
||||||
|
|
||||||
|
# 2. 從本地倉庫強制同步 (因為是 Host 模式,絕對讀得到路徑)
|
||||||
|
echo "Fetching from local gitea storage..."
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
|
||||||
# 重啟 Docker
|
# 3. 重新啟動 Docker 容器
|
||||||
|
echo "Restarting Docker Compose..."
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
|
|
||||||
echo "終於成功部署了!"
|
echo "Deployment successful!"
|
||||||
Reference in New Issue
Block a user