mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
23 lines
706 B
YAML
23 lines
706 B
YAML
name: Oracle-Deploy
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
redeploy:
|
|
runs-on: ubuntu-latest # 改成這個,對應你的 Runner 標籤
|
|
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 compose up -d --build --remove-orphans
|
|
docker image prune -f |