In single repo, I want to create more than one trigger for different paths [paths: 'frontend/**'
and paths: 'backend/**'
] with different parameters for (same) build jobs. Following are the two workflow.
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"}'
...
and
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"}'
...
Can I combine these two in a single workflow file (.github/workflows/
) or it need to have separate files for each ?
Note : job_params
are different in for both triggers.
job_params
are different for both triggers. – Teplica