Files
star-erp/.gitea/workflows/deploy.yaml
sky121113 1dc1fa3993
Some checks failed
Koori-ERP-Deploy / auto-deploy (push) Failing after 10s
v2
2025-12-31 09:29:32 +08:00

39 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Koori-ERP-Deploy
on:
push:
branches:
- main
jobs:
auto-deploy:
runs-on: ubuntu-latest
steps:
- name: 1. Checkout Code
uses: actions/checkout@v3
with:
# --- 關鍵:直接指定 Gitea 的伺服器網址為 IP ---
github-server-url: http://192.168.0.103:3000
repository: ${{ gitea.repository }}
# ------------------------------------------
- name: 2. Create .env from Secrets
run: echo "${{ secrets.DOT_ENV }}" > .env
- name: 3. Build and Start Docker
run: |
# 使用 --remove-orphans 會自動清掉不屬於目前配置的舊容器
# 使用 -v 會清掉匿名的 volumes避免資料殘留
docker compose down --remove-orphans
- name: 4. Initialize Laravel
run: |
# 先進容器確認 composer.json 是否真的在那裡
docker exec koori-erp-laravel.test-1 ls -F /var/www/html/
# 執行安裝
docker exec -w /var/www/html koori-erp-laravel.test-1 composer install --optimize-autoloader --no-dev
# 其他初始化指令
docker exec koori-erp-laravel.test-1 php artisan key:generate --force
docker exec koori-erp-laravel.test-1 php artisan storage:link
docker exec koori-erp-laravel.test-1 php artisan migrate --force