From 1c7be40c3a58df22f8abeed367e983c7257ea0f2 Mon Sep 17 00:00:00 2001 From: work Date: Tue, 8 Jul 2025 16:31:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=81=9C=E6=AD=A2=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=88=86=E5=BC=80=E6=89=A7=E8=A1=8C,=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/cd.yaml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index abe0450..b0c89bb 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -7,14 +7,30 @@ on: env: DESTINATION: C:\Facebook 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: StopService: - - name: Stop previous service - run: | - try { - Stop-Process -Name "python" -Force -ErrorAction SilentlyContinue - } catch {} + needs: StopService + runs-on: ${{ matrix.machine }} + defaults: + run: + 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: needs: StopService runs-on: ${{ matrix.machine }} @@ -23,9 +39,7 @@ jobs: shell: powershell strategy: matrix: - machine: - - windows-101.36.102.136 - - windows-101.36.104.175 + machine: ${{ fromJson(env.MACHINES) }} # 使用公共的 machines 列表 steps: - name: 更新或clone项目 shell: powershell