@@ -2,11 +2,6 @@ name: Branch Build
2
2
3
3
on :
4
4
workflow_dispatch :
5
- inputs :
6
- branch_name :
7
- description : " Branch Name"
8
- required : true
9
- default : " preview"
10
5
push :
11
6
branches :
12
7
- master
16
11
types : [released, prereleased]
17
12
18
13
env :
19
- TARGET_BRANCH : ${{ inputs.branch_name || github.ref_name || github.event.release.target_commitish }}
14
+ TARGET_BRANCH : ${{ github.ref_name || github.event.release.target_commitish }}
20
15
21
16
jobs :
22
17
branch_build_setup :
23
18
name : Build-Push Web/Space/API/Proxy Docker Image
24
- runs-on : ubuntu-20.04
25
- steps :
26
- - name : Check out the repo
27
-
19
+ runs-on : ubuntu-latest
28
20
outputs :
29
- gh_branch_name : ${{ env.TARGET_BRANCH }}
21
+ gh_branch_name : ${{ steps.set_env_variables.outputs.TARGET_BRANCH }}
22
+ gh_buildx_driver : ${{ steps.set_env_variables.outputs.BUILDX_DRIVER }}
23
+ gh_buildx_version : ${{ steps.set_env_variables.outputs.BUILDX_VERSION }}
24
+ gh_buildx_platforms : ${{ steps.set_env_variables.outputs.BUILDX_PLATFORMS }}
25
+ gh_buildx_endpoint : ${{ steps.set_env_variables.outputs.BUILDX_ENDPOINT }}
26
+
27
+ steps :
28
+ - id : set_env_variables
29
+ name : Set Environment Variables
30
+ run : |
31
+ if [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
32
+ echo "BUILDX_DRIVER=cloud" >> $GITHUB_OUTPUT
33
+ echo "BUILDX_VERSION=lab:latest" >> $GITHUB_OUTPUT
34
+ echo "BUILDX_PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
35
+ echo "BUILDX_ENDPOINT=makeplane/plane-dev" >> $GITHUB_OUTPUT
36
+ else
37
+ echo "BUILDX_DRIVER=docker-container" >> $GITHUB_OUTPUT
38
+ echo "BUILDX_VERSION=latest" >> $GITHUB_OUTPUT
39
+ echo "BUILDX_PLATFORMS=linux/amd64" >> $GITHUB_OUTPUT
40
+ echo "BUILDX_ENDPOINT=local" >> $GITHUB_OUTPUT
41
+ fi
42
+ echo "TARGET_BRANCH=${{ env.TARGET_BRANCH }}" >> $GITHUB_OUTPUT
30
43
31
44
branch_build_push_frontend :
32
45
runs-on : ubuntu-20.04
33
46
needs : [branch_build_setup]
34
47
env :
35
48
FRONTEND_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ needs.branch_build_setup.outputs.gh_branch_name }}
49
+ TARGET_BRANCH : ${{ needs.branch_build_setup.outputs.gh_branch_name }}
50
+ BUILDX_DRIVER : ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
51
+ BUILDX_VERSION : ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
52
+ BUILDX_PLATFORMS : ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
53
+ BUILDX_ENDPOINT : ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
36
54
steps :
37
55
- name : Set Frontend Docker Tag
38
56
run : |
39
- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
57
+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
40
58
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ github.event.release.tag_name }}
41
- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
59
+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
42
60
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:stable
43
61
else
44
62
TAG=${{ env.FRONTEND_TAG }}
45
63
fi
46
64
echo "FRONTEND_TAG=${TAG}" >> $GITHUB_ENV
47
- - name : Docker Setup QEMU
48
-
49
-
50
- - name : Set up Docker Buildx
51
-
52
- with :
53
- platforms : linux/amd64,linux/arm64
54
- buildkitd-flags : " --allow-insecure-entitlement security.insecure"
55
65
56
66
- name : Login to Docker Hub
57
- uses : docker/login-action@v3.0.0
67
+ uses : docker/login-action@v3
58
68
with :
59
69
username : ${{ secrets.DOCKERHUB_USERNAME }}
60
70
password : ${{ secrets.DOCKERHUB_TOKEN }}
61
71
72
+ - name : Set up Docker Buildx
73
+ uses : docker/setup-buildx-action@v3
74
+ with :
75
+ driver : ${{ env.BUILDX_DRIVER }}
76
+ version : ${{ env.BUILDX_VERSION }}
77
+ endpoint : ${{ env.BUILDX_ENDPOINT }}
78
+
62
79
- name : Check out the repo
63
80
64
81
67
84
with :
68
85
context : .
69
86
file : ./web/Dockerfile.web
70
- platforms : linux/amd64
87
+ platforms : ${{ env.BUILDX_PLATFORMS }}
71
88
tags : ${{ env.FRONTEND_TAG }}
72
89
push : true
73
90
env :
@@ -80,33 +97,36 @@ jobs:
80
97
needs : [branch_build_setup]
81
98
env :
82
99
SPACE_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ needs.branch_build_setup.outputs.gh_branch_name }}
100
+ TARGET_BRANCH : ${{ needs.branch_build_setup.outputs.gh_branch_name }}
101
+ BUILDX_DRIVER : ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
102
+ BUILDX_VERSION : ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
103
+ BUILDX_PLATFORMS : ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
104
+ BUILDX_ENDPOINT : ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
83
105
steps :
84
106
- name : Set Space Docker Tag
85
107
run : |
86
- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
108
+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
87
109
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ github.event.release.tag_name }}
88
- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
110
+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
89
111
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:stable
90
112
else
91
113
TAG=${{ env.SPACE_TAG }}
92
114
fi
93
115
echo "SPACE_TAG=${TAG}" >> $GITHUB_ENV
94
116
95
- - name : Docker Setup QEMU
96
-
97
-
98
- - name : Set up Docker Buildx
99
-
100
- with :
101
- platforms : linux/amd64,linux/arm64
102
- buildkitd-flags : " --allow-insecure-entitlement security.insecure"
103
-
104
117
- name : Login to Docker Hub
105
- uses : docker/login-action@v3.0.0
118
+ uses : docker/login-action@v3
106
119
with :
107
120
username : ${{ secrets.DOCKERHUB_USERNAME }}
108
121
password : ${{ secrets.DOCKERHUB_TOKEN }}
109
122
123
+ - name : Set up Docker Buildx
124
+ uses : docker/setup-buildx-action@v3
125
+ with :
126
+ driver : ${{ env.BUILDX_DRIVER }}
127
+ version : ${{ env.BUILDX_VERSION }}
128
+ endpoint : ${{ env.BUILDX_ENDPOINT }}
129
+
110
130
- name : Check out the repo
111
131
112
132
@@ -115,7 +135,7 @@ jobs:
115
135
with :
116
136
context : .
117
137
file : ./space/Dockerfile.space
118
- platforms : linux/amd64
138
+ platforms : ${{ env.BUILDX_PLATFORMS }}
119
139
tags : ${{ env.SPACE_TAG }}
120
140
push : true
121
141
env :
@@ -128,33 +148,36 @@ jobs:
128
148
needs : [branch_build_setup]
129
149
env :
130
150
BACKEND_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ needs.branch_build_setup.outputs.gh_branch_name }}
151
+ TARGET_BRANCH : ${{ needs.branch_build_setup.outputs.gh_branch_name }}
152
+ BUILDX_DRIVER : ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
153
+ BUILDX_VERSION : ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
154
+ BUILDX_PLATFORMS : ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
155
+ BUILDX_ENDPOINT : ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
131
156
steps :
132
157
- name : Set Backend Docker Tag
133
158
run : |
134
- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
159
+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
135
160
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ github.event.release.tag_name }}
136
- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
161
+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
137
162
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:stable
138
163
else
139
164
TAG=${{ env.BACKEND_TAG }}
140
165
fi
141
166
echo "BACKEND_TAG=${TAG}" >> $GITHUB_ENV
142
167
143
- - name : Docker Setup QEMU
144
-
145
-
146
- - name : Set up Docker Buildx
147
-
148
- with :
149
- platforms : linux/amd64,linux/arm64
150
- buildkitd-flags : " --allow-insecure-entitlement security.insecure"
151
-
152
168
- name : Login to Docker Hub
153
- uses : docker/login-action@v3.0.0
169
+ uses : docker/login-action@v3
154
170
with :
155
171
username : ${{ secrets.DOCKERHUB_USERNAME }}
156
172
password : ${{ secrets.DOCKERHUB_TOKEN }}
157
173
174
+ - name : Set up Docker Buildx
175
+ uses : docker/setup-buildx-action@v3
176
+ with :
177
+ driver : ${{ env.BUILDX_DRIVER }}
178
+ version : ${{ env.BUILDX_VERSION }}
179
+ endpoint : ${{ env.BUILDX_ENDPOINT }}
180
+
158
181
- name : Check out the repo
159
182
160
183
@@ -163,46 +186,50 @@ jobs:
163
186
with :
164
187
context : ./apiserver
165
188
file : ./apiserver/Dockerfile.api
166
- platforms : linux/amd64
189
+ platforms : ${{ env.BUILDX_PLATFORMS }}
167
190
push : true
168
191
tags : ${{ env.BACKEND_TAG }}
169
192
env :
170
193
DOCKER_BUILDKIT : 1
171
194
DOCKER_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
172
195
DOCKER_PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
173
196
197
+
174
198
branch_build_push_proxy :
175
199
runs-on : ubuntu-20.04
176
200
needs : [branch_build_setup]
177
201
env :
178
202
PROXY_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ needs.branch_build_setup.outputs.gh_branch_name }}
203
+ TARGET_BRANCH : ${{ needs.branch_build_setup.outputs.gh_branch_name }}
204
+ BUILDX_DRIVER : ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
205
+ BUILDX_VERSION : ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
206
+ BUILDX_PLATFORMS : ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
207
+ BUILDX_ENDPOINT : ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}
179
208
steps :
180
209
- name : Set Proxy Docker Tag
181
210
run : |
182
- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
211
+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
183
212
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ github.event.release.tag_name }}
184
- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
213
+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; then
185
214
TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:stable
186
215
else
187
216
TAG=${{ env.PROXY_TAG }}
188
217
fi
189
218
echo "PROXY_TAG=${TAG}" >> $GITHUB_ENV
190
219
191
- - name : Docker Setup QEMU
192
-
193
-
194
- - name : Set up Docker Buildx
195
-
196
- with :
197
- platforms : linux/amd64,linux/arm64
198
- buildkitd-flags : " --allow-insecure-entitlement security.insecure"
199
-
200
220
- name : Login to Docker Hub
201
- uses : docker/login-action@v3.0.0
221
+ uses : docker/login-action@v3
202
222
with :
203
223
username : ${{ secrets.DOCKERHUB_USERNAME }}
204
224
password : ${{ secrets.DOCKERHUB_TOKEN }}
205
225
226
+ - name : Set up Docker Buildx
227
+ uses : docker/setup-buildx-action@v3
228
+ with :
229
+ driver : ${{ env.BUILDX_DRIVER }}
230
+ version : ${{ env.BUILDX_VERSION }}
231
+ endpoint : ${{ env.BUILDX_ENDPOINT }}
232
+
206
233
- name : Check out the repo
207
234
208
235
@@ -211,10 +238,11 @@ jobs:
211
238
with :
212
239
context : ./nginx
213
240
file : ./nginx/Dockerfile
214
- platforms : linux/amd64
241
+ platforms : ${{ env.BUILDX_PLATFORMS }}
215
242
tags : ${{ env.PROXY_TAG }}
216
243
push : true
217
244
env :
218
245
DOCKER_BUILDKIT : 1
219
246
DOCKER_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
220
247
DOCKER_PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
248
+
0 commit comments