在单个代码库中,我想为不同的路径 [
我可以将这两个内容合并到一个工作流程文件 (
paths: 'frontend/**'
和 paths: 'backend/**'
] 创建多个触发器,并为(相同的)构建作业设置不同的参数。以下是两个工作流程。name: Trigger Jenkins Build [ Build-Portal ]
on:
push:
branches: [ develop ]
paths: 'frontend/**'
types: [closed]
jobs:
build:
name: Triggering Jenkins Build [ Build-Portal ]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Trigger Build-Portal
uses: actions/trigger-jenkins@develop
with:
...
job_name: "Build-Portal"
job_params: '{"FRESH_BUILD":"True", "UI":"True", "BUILD_BRANCH":"develop", "DEPLOY_DEV":"True"}'
...
和
name: Trigger Jenkins Build [ Build-Portal ]
on:
push:
branches: [ develop ]
paths: 'backend/**'
types: [closed]
jobs:
build:
name: Triggering Jenkins Build [ Build-Portal ]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Trigger Build-Portal
uses: actions/trigger-jenkins@develop
with:
...
job_name: "Build-Portal"
job_params: '{"FRESH_BUILD":"True", "API":"True", "BUILD_BRANCH":"develop", "DEPLOY_DEV":"True"}'
...
我可以将这两个内容合并到一个工作流程文件 (
.github/workflows/
) 中吗?还是需要为每个单独创建一个文件?注意:对于两个触发器,job_params
是不同的。
job_params
对于两个触发器是不同的。 - roy