Files
fin_buddy_fe/.gitea/workflows/deploy.yml
henry yo 80fdd49b34
Some checks failed
Deploy Frontend to 1Panel / build-and-deploy (push) Failing after 18s
fix: change config
2026-06-26 00:12:42 +08:00

35 lines
1020 B
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: Deploy Frontend to 1Panel
on:
push:
branches:
- main # 🎯 或者是 master看你的預設分支是哪一個
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22 # 🎯 對齊你的 Node 版本
- name: Install Dependencies
run: npm install
- name: Build Project
run: npm run build # 🎯 編譯出 dist 資料夾
- name: Copy Files to 1Panel Site Directory
run: |
# 1. 確保 1Panel 的目標目錄存在
sudo mkdir -p /www/sites/fin-buddy.duckdns.org/index/
# 2. 直接把打包好的 dist 檔案暴力複製過去
sudo cp -r dist/* /www/sites/fin-buddy.duckdns.org/index/
# 3. 修正檔案權限,確保 1Panel 的 Nginx 讀得到
sudo chmod -r 755 /www/sites/fin-buddy.duckdns.org/index/