mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
feat: linebot
change deploy.yaml
This commit is contained in:
@@ -6,18 +6,16 @@ on:
|
||||
|
||||
jobs:
|
||||
redeploy:
|
||||
runs-on: ubuntu-latest # 改成這個,對應你的 Runner 標籤
|
||||
runs-on: self-hosted # 這裡確保對應到你的 Runner 標籤
|
||||
container:
|
||||
image: "" # <--- 最關鍵的一行!設為空字串,強迫它在 Host 執行
|
||||
steps:
|
||||
- name: Sync and Deploy
|
||||
run: |
|
||||
# 1. 進入目錄 (若失敗直接停止)
|
||||
cd /home/ubuntu/apps/linebot_finance || exit 1
|
||||
|
||||
# 2. 強制更新代碼 (避免任何 conflict 導致卡住)
|
||||
# 注意:這裡假設你已經執行過 git config credential.helper store 讓它記住密碼了
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
|
||||
# 3. 部署與清理
|
||||
# 現在它絕對抓得到宿主機的 docker 了
|
||||
docker compose up -d --build --remove-orphans
|
||||
docker image prune -f
|
||||
Reference in New Issue
Block a user