main test
Some checks failed
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Failing after 27s

This commit is contained in:
2026-01-06 10:30:13 +08:00
parent 6631f64e4b
commit e31715becb

View File

@@ -31,48 +31,48 @@ jobs:
docker exec koori-erp-laravel chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache docker exec koori-erp-laravel chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
# --- 2. 正式環境部署 (erp.koori.tw:2224) --- # --- 2. 正式環境部署 (erp.koori.tw:2224) ---
# deploy-production: deploy-production:
# if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# steps: steps:
# - name: Checkout Code - name: Checkout Code
# uses: actions/checkout@v3 uses: actions/checkout@v3
# # 使用 rsync 透過 2224 Port 推送代碼 # 使用 rsync 透過 2224 Port 推送代碼
# - name: Push Code to Production - name: Push Code to Production
# run: | run: |
# # 注意:這裡的 -e 指定了 ssh port 2224 # 注意:這裡的 -e 指定了 ssh port 2224
# rsync -avz --delete \ rsync -avz --delete \
# --exclude='.git' \ --exclude='.git' \
# --exclude='node_modules' \ --exclude='node_modules' \
# --exclude='vendor' \ --exclude='vendor' \
# -e "ssh -p 2224 -o StrictHostKeyChecking=no" \ -e "ssh -p 2224 -o StrictHostKeyChecking=no" \
# ./ root@erp.koori.tw:/var/www/koori-erp-prod/ ./ root@erp.koori.tw:/var/www/koori-erp-prod/
# # 遠端執行 Docker 指令 # 遠端執行 Docker 指令
# - name: Remote Docker Commands - name: Remote Docker Commands
# uses: appleboy/ssh-action@master uses: appleboy/ssh-action@master
# with: with:
# host: erp.koori.tw host: erp.koori.tw
# port: 2224 # <--- 這裡指定了 2224 Port port: 2224 # <--- 這裡指定了 2224 Port
# username: root username: root
# key: ${{ secrets.PROD_SSH_KEY }} key: ${{ secrets.PROD_SSH_KEY }}
# script: | script: |
# cd /var/www/koori-erp-prod cd /var/www/koori-erp-prod
# # 1. 確保 .env 存在 (建議正式機手動維護 .env不隨 git 連動) # 1. 確保 .env 存在 (建議正式機手動維護 .env不隨 git 連動)
# if [ ! -f .env ]; then cp .env.example .env; fi if [ ! -f .env ]; then cp .env.example .env; fi
# # 2. 啟動容器 # 2. 啟動容器
# docker compose up -d --build docker compose up -d --build
# # 3. 執行 Laravel 正式環境優化流程 # 3. 執行 Laravel 正式環境優化流程
# docker exec -u 1000:1000 koori-erp-laravel-prod sh -c " docker exec -u 1000:1000 koori-erp-laravel-prod sh -c "
# composer install --no-dev --optimize-autoloader && composer install --no-dev --optimize-autoloader &&
# npm install && npm install &&
# npm run build && npm run build &&
# php artisan migrate --force && php artisan migrate --force &&
# php artisan config:cache && php artisan config:cache &&
# php artisan route:cache && php artisan route:cache &&
# php artisan view:cache php artisan view:cache
# " "