v12
Some checks failed
Koori-ERP-Deploy / auto-deploy (push) Failing after 22s

This commit is contained in:
2025-12-31 11:05:18 +08:00
parent ada08dddc1
commit 3b0feae7b4

View File

@@ -21,14 +21,8 @@ jobs:
- name: 3. Build and Start Docker
run: |
# 1. 強制讀取當前目錄剛生成的 .env 內容(確保拿到 8081
# 並直接導出給 Shell
export $(grep -v '^#' .env | xargs)
# 2. 顯示一下現在讀到的埠號,確認沒讀錯 (會在 Action 日誌看到)
echo "Debug: Current APP_PORT is $APP_PORT"
# 3. 在啟動指令前,直接把變數塞進去 (這招優先權最高,會覆蓋所有 .env)
APP_PORT=$(grep '^APP_PORT=' .env | cut -d '=' -f2)
echo "Debug: APP_PORT=$APP_PORT"
APP_PORT=$APP_PORT docker compose down --remove-orphans
APP_PORT=$APP_PORT docker compose up -d --build --force-recreate