🚀 chore: 优化 GitHub Actions Web 部署工作

This commit is contained in:
alger
2025-03-09 12:13:19 +08:00
parent 7f8ab8be7c
commit 4a66796747
+9
View File
@@ -4,6 +4,7 @@ on:
push: push:
branches: branches:
- dev_electron # 或者您的主分支名称 - dev_electron # 或者您的主分支名称
workflow_dispatch: # 允许手动触发
jobs: jobs:
build-and-deploy: build-and-deploy:
@@ -16,6 +17,13 @@ jobs:
with: with:
node-version: '18' node-version: '18'
- name: 创建环境变量文件
run: |
echo "VITE_API=${{ secrets.VITE_API }}" > .env.production.local
echo "VITE_API_MUSIC=${{ secrets.VITE_API_MUSIC }}" >> .env.production.local
# 添加其他需要的环境变量
cat .env.production.local # 查看创建的文件内容,调试用
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
@@ -40,3 +48,4 @@ jobs:
key: ${{ secrets.DEPLOY_KEY }} key: ${{ secrets.DEPLOY_KEY }}
script: | script: |
cd ${{ secrets.DEPLOY_PATH }} cd ${{ secrets.DEPLOY_PATH }}
echo "部署完成于 $(date)"