mirror of
https://github.com/henry4682/linebot_finance.git
synced 2026-05-16 04:41:52 +00:00
This commit is contained in:
@@ -11,14 +11,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Preparation and Git Sync
|
- name: Preparation and Git Sync
|
||||||
run: |
|
run: |
|
||||||
# 建立目錄並進入
|
# 建立父目錄
|
||||||
mkdir -p /home/ubuntu/apps/linebot_finance
|
mkdir -p /home/ubuntu/apps/linebot_finance
|
||||||
cd /home/ubuntu/apps/linebot_finance
|
cd /home/ubuntu/apps/linebot_finance
|
||||||
|
|
||||||
# 檢查是否已經有 .git,沒有就 clone,有就 reset
|
# 核心邏輯:如果不是 Git 儲存庫,就清空它
|
||||||
if [ ! -d ".git" ]; then
|
if [ ! -d ".git" ]; then
|
||||||
echo "🚚 正在初始化儲存庫..."
|
echo "⚠️ 目錄已存在但非 Git 儲存庫,正在清空以重新初始化..."
|
||||||
# 使用 http://localhost:3000 是因為你的 Runner 跟 Gitea 在同一台主機且用了 network host
|
rm -rf ..?* .[!.]* * # 刪除隱藏檔與一般檔案
|
||||||
git clone http://localhost:3000/henry4682/linebot_finance.git .
|
git clone http://localhost:3000/henry4682/linebot_finance.git .
|
||||||
else
|
else
|
||||||
echo "🔄 正在更新現有儲存庫..."
|
echo "🔄 正在更新現有儲存庫..."
|
||||||
|
|||||||
Reference in New Issue
Block a user