将停止服务分开执行, 修复

This commit is contained in:
work
2025-07-08 16:31:43 +08:00
parent d88675cfe3
commit 1c7be40c3a

View File

@@ -7,14 +7,30 @@ on:
env: env:
DESTINATION: C:\Facebook DESTINATION: C:\Facebook
REPOSITORY_URL: http://deploy:123qwe123@123.58.209.87:3000/py_facebook/py_facebook.git REPOSITORY_URL: http://deploy:123qwe123@123.58.209.87:3000/py_facebook/py_facebook.git
MACHINES: |
[
"windows-101.36.102.136",
"windows-101.36.104.175"
]
jobs: jobs:
StopService: StopService:
- name: Stop previous service needs: StopService
run: | runs-on: ${{ matrix.machine }}
try { defaults:
Stop-Process -Name "python" -Force -ErrorAction SilentlyContinue run:
} catch {} shell: powershell
strategy:
matrix:
machine: ${{ fromJson(env.MACHINES) }} # 使用公共的 machines 列表
steps:
- name: Stop previous service
run: |
try {
Stop-Process -Name "python" -Force -ErrorAction SilentlyContinue
} catch {}
CD: CD:
needs: StopService needs: StopService
runs-on: ${{ matrix.machine }} runs-on: ${{ matrix.machine }}
@@ -23,9 +39,7 @@ jobs:
shell: powershell shell: powershell
strategy: strategy:
matrix: matrix:
machine: machine: ${{ fromJson(env.MACHINES) }} # 使用公共的 machines 列表
- windows-101.36.102.136
- windows-101.36.104.175
steps: steps:
- name: 更新或clone项目 - name: 更新或clone项目
shell: powershell shell: powershell