1
1
name : Build Docker Image
2
2
3
3
on :
4
- push :
5
- branches :
6
- - " master"
4
+ workflow_call :
5
+ inputs :
6
+ push_images :
7
+ default : false
8
+ type : boolean
9
+ secrets :
10
+ dockerhub_username :
11
+ dockerhub_token :
7
12
8
13
jobs :
9
14
docker :
@@ -18,109 +23,110 @@ jobs:
18
23
- name : Login to DockerHub
19
24
uses : docker/login-action@v1
20
25
with :
21
- username : ${{ secrets.DOCKERHUB_USERNAME }}
22
- password : ${{ secrets.DOCKERHUB_TOKEN }}
23
- - name : Build And Push 7.1-alpine
26
+ username : ${{ secrets.dockerhub_username }}
27
+ password : ${{ secrets.dockerhub_token }}
28
+ if : github.ref_name == github.event.repository.default_branch
29
+ - name : Build 7.1-alpine
24
30
uses : docker/build-push-action@v2
25
31
with :
26
32
context : .
27
33
file : ./images/7.1/Dockerfile-alpine
28
- push : true
34
+ push : ${{ inputs.push_images }}
29
35
tags : umutphp/php-docker-images-for-ci:7.1-alpine
30
- - name : Build And Push 7.2-alpine
36
+ - name : Build 7.2-alpine
31
37
uses : docker/build-push-action@v2
32
38
with :
33
39
context : .
34
40
file : ./images/7.2/Dockerfile-alpine
35
- push : true
41
+ push : ${{ inputs.push_images }}
36
42
tags : umutphp/php-docker-images-for-ci:7.2-alpine
37
- - name : Build And Push 7.3-alpine
43
+ - name : Build 7.3-alpine
38
44
uses : docker/build-push-action@v2
39
45
with :
40
46
context : .
41
47
file : ./images/7.3/Dockerfile-alpine
42
- push : true
48
+ push : ${{ inputs.push_images }}
43
49
tags : umutphp/php-docker-images-for-ci:7.3-alpine
44
- - name : Build And Push 7.4-alpine
50
+ - name : Build 7.4-alpine
45
51
uses : docker/build-push-action@v2
46
52
with :
47
53
context : .
48
54
file : ./images/7.4/Dockerfile-alpine
49
- push : true
55
+ push : ${{ inputs.push_images }}
50
56
tags : umutphp/php-docker-images-for-ci:7.4-alpine
51
- - name : Build And Push 8.0-alpine
57
+ - name : Build 8.0-alpine
52
58
uses : docker/build-push-action@v2
53
59
with :
54
60
context : .
55
61
file : ./images/8.0/Dockerfile-alpine
56
- push : true
62
+ push : ${{ inputs.push_images }}
57
63
tags : umutphp/php-docker-images-for-ci:8.0-alpine
58
- - name : Build And Push 8.1-alpine
64
+ - name : Build 8.1-alpine
59
65
uses : docker/build-push-action@v2
60
66
with :
61
67
context : .
62
68
file : ./images/8.1/Dockerfile-alpine
63
- push : true
69
+ push : ${{ inputs.push_images }}
64
70
tags : umutphp/php-docker-images-for-ci:8.1-alpine
65
- - name : Build And Push 8.2-alpine
71
+ - name : Build 8.2-alpine
66
72
uses : docker/build-push-action@v2
67
73
with :
68
74
context : .
69
75
file : ./images/8.2/Dockerfile-alpine
70
- push : true
76
+ push : ${{ inputs.push_images }}
71
77
tags : umutphp/php-docker-images-for-ci:8.2-alpine
72
- - name : Build And Push 8.3-alpine
78
+ - name : Build 8.3-alpine
73
79
uses : docker/build-push-action@v2
74
80
with :
75
81
context : .
76
82
file : ./images/8.3/Dockerfile-alpine
77
- push : true
83
+ push : ${{ inputs.push_images }}
78
84
tags : umutphp/php-docker-images-for-ci:8.3-alpine,umutphp/php-docker-images-for-ci:latest-alpine
79
- - name : Build And Push 7.1
85
+ - name : Build 7.1
80
86
uses : docker/build-push-action@v2
81
87
with :
82
88
context : ./images/7.1/
83
- push : true
89
+ push : ${{ inputs.push_images }}
84
90
tags : umutphp/php-docker-images-for-ci:7.1
85
- - name : Build And Push 7.2
91
+ - name : Build 7.2
86
92
uses : docker/build-push-action@v2
87
93
with :
88
94
context : ./images/7.2/
89
- push : true
95
+ push : ${{ inputs.push_images }}
90
96
tags : umutphp/php-docker-images-for-ci:7.2
91
- - name : Build And Push 7.3
97
+ - name : Build 7.3
92
98
uses : docker/build-push-action@v2
93
99
with :
94
100
context : ./images/7.3/
95
- push : true
101
+ push : ${{ inputs.push_images }}
96
102
tags : umutphp/php-docker-images-for-ci:7.3
97
- - name : Build And Push 7.4
103
+ - name : Build 7.4
98
104
uses : docker/build-push-action@v2
99
105
with :
100
106
context : ./images/7.4/
101
- push : true
107
+ push : ${{ inputs.push_images }}
102
108
tags : umutphp/php-docker-images-for-ci:7.4
103
- - name : Build And Push 8.0
109
+ - name : Build 8.0
104
110
uses : docker/build-push-action@v2
105
111
with :
106
112
context : ./images/8.0/
107
- push : true
113
+ push : ${{ inputs.push_images }}
108
114
tags : umutphp/php-docker-images-for-ci:8.0
109
- - name : Build And Push 8.1
115
+ - name : Build 8.1
110
116
uses : docker/build-push-action@v2
111
117
with :
112
118
context : ./images/8.1/
113
- push : true
119
+ push : ${{ inputs.push_images }}
114
120
tags : umutphp/php-docker-images-for-ci:8.1
115
- - name : Build And Push 8.2
121
+ - name : Build 8.2
116
122
uses : docker/build-push-action@v2
117
123
with :
118
124
context : ./images/8.2/
119
- push : true
125
+ push : ${{ inputs.push_images }}
120
126
tags : umutphp/php-docker-images-for-ci:8.2
121
- - name : Build And Push 8.3
127
+ - name : Build 8.3
122
128
uses : docker/build-push-action@v2
123
129
with :
124
130
context : ./images/8.3/
125
- push : true
131
+ push : ${{ inputs.push_images }}
126
132
tags : umutphp/php-docker-images-for-ci:8.3,umutphp/php-docker-images-for-ci:latest
0 commit comments