v9
All checks were successful
Koori-ERP-Deploy / auto-deploy (push) Successful in 49s

This commit is contained in:
2025-12-31 10:49:58 +08:00
parent f3a04d3ef6
commit a64fe3d7ba

View File

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