-
Notifications
You must be signed in to change notification settings - Fork 7
40 lines (36 loc) · 1002 Bytes
/
deploy-ENV.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Github actions to execute deploy-ENV jobs based on branch
name: deploy_ENV
on:
push:
branches:
- master
- dev
env:
JENKINS_HOST: https://jenkins.asociaciondrupal.es
jobs:
launch_jenkins_deploy:
name: Launch jenkins deploy-ENV job
runs-on: ubuntu-latest
steps:
-
name: Decide Jenkins job to run
uses: kanga333/variable-mapper@master
with:
key: ${{ github.ref }}
map: |
{
"master": {
"JENKINS_JOB": "${{ secrets.JENKINS_JOB_PROD }}"
},
"dev": {
"JENKINS_JOB": "${{ secrets.JENKINS_JOB_DEV }}"
}
}
-
name: Trigger Jenkins Job
uses: sbitio/[email protected]
with:
JENKINS_USER: ${{ secrets.JENKINS_USER }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
JENKINS_HOST: ${{ env.JENKINS_HOST }}
JENKINS_JOB: ${{ env.JENKINS_JOB }}