删除 .gitea/workflows/develop_build_commit.yaml
This commit is contained in:
@@ -1,56 +0,0 @@
|
|||||||
name: git commit 控制 AiDA WEB-Node.js Develop 分支构建部署123
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev_vite
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "contains(github.event.head_commit.message, '[run build]')"
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [ 18.18.0 ]
|
|
||||||
|
|
||||||
env:
|
|
||||||
REMOTE_DEPLOY_PATH: /workspace/workspace_aida/DevelopVersion/develop-aida-web-front
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: 1.检出代码
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: 2.设置 Node.js 环境
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
- run: npm install
|
|
||||||
- run: npm run build:dev
|
|
||||||
- run: ls -l
|
|
||||||
|
|
||||||
- name: 3.同步文件到远程服务器
|
|
||||||
uses: appleboy/scp-action@v0.1.7
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
|
||||||
username: ${{ secrets.SERVER_USER }}
|
|
||||||
key: ${{ secrets.SSH_KEY }}
|
|
||||||
source: "./dist/*"
|
|
||||||
target: ${{ env.REMOTE_DEPLOY_PATH }}
|
|
||||||
ssh_options: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
|
||||||
strip_components: 0
|
|
||||||
|
|
||||||
- name: 4. 远程重载 Nginx 配置
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
|
||||||
username: ${{ secrets.SERVER_USER }}
|
|
||||||
key: ${{ secrets.SSH_KEY }}
|
|
||||||
# 核心:执行 Nginx 重载命令
|
|
||||||
script: |
|
|
||||||
echo "尝试重载 Nginx 服务..."
|
|
||||||
# 💡 注意:执行此命令需要服务器用户具有 sudo 权限,并且配置了 NOPASSWD。
|
|
||||||
# 否则工作流可能会因为权限不足而失败。
|
|
||||||
sudo systemctl reload nginx
|
|
||||||
echo "Nginx 重载命令已发送。"
|
|
||||||
Reference in New Issue
Block a user