mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
25 lines
695 B
YAML
25 lines
695 B
YAML
name: Oracle-Deploy
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
redeploy:
|
|
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
|
|
|
|
# 更新程式碼
|
|
git fetch --all
|
|
git reset --hard origin/main
|
|
|
|
# 重啟 Docker 容器
|
|
# 建議加上 --build 確保 Python/PHP 程式碼變動有被更新進 image
|
|
docker compose up -d --build |