11name : Branch Build
22
33on :
4- pull_request :
5- types :
6- - closed
4+ workflow_dispatch :
5+ inputs :
6+ branch_name :
7+ description : " Branch Name"
8+ required : true
9+ default : " preview"
10+ push :
711 branches :
812 - master
913 - preview
10- - qa
1114 - develop
12- - release-*
1315 release :
1416 types : [released, prereleased]
1517
1618env :
17- TARGET_BRANCH : ${{ github.event.pull_request.base.ref || github.event.release.target_commitish }}
19+ TARGET_BRANCH : ${{ inputs.branch_name || github.ref_name || github.event.release.target_commitish }}
1820
1921jobs :
2022 branch_build_setup :
21- if : ${{ (github.event_name == 'pull_request' && github.event.action =='closed' && github.event.pull_request.merged == true) || github.event_name == 'release' }}
2223 name : Build-Push Web/Space/API/Proxy Docker Image
2324 runs-on : ubuntu-20.04
24-
2525 steps :
2626 - name : Check out the repo
272728-
29- - name : Uploading Proxy Source
30- uses : actions/upload-artifact@v3
31- with :
32- name : proxy-src-code
33- path : ./nginx
34- - name : Uploading Backend Source
35- uses : actions/upload-artifact@v3
36- with :
37- name : backend-src-code
38- path : ./apiserver
39- - name : Uploading Web Source
40- uses : actions/upload-artifact@v3
41- with :
42- name : web-src-code
43- path : |
44- ./
45- !./apiserver
46- !./nginx
47- !./deploy
48- !./space
49- - name : Uploading Space Source
50- uses : actions/upload-artifact@v3
51- with :
52- name : space-src-code
53- path : |
54- ./
55- !./apiserver
56- !./nginx
57- !./deploy
58- !./web
5928 outputs :
6029 gh_branch_name : ${{ env.TARGET_BRANCH }}
6130
6231 branch_build_push_frontend :
6332 runs-on : ubuntu-20.04
6433 needs : [branch_build_setup]
6534 env :
66- FRONTEND_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ needs.branch_build_setup.outputs.gh_branch_name }}
35+ FRONTEND_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ needs.branch_build_setup.outputs.gh_branch_name }}
6736 steps :
68- - name : Set Frontend Docker Tag
37+ - name : Set Frontend Docker Tag
6938 run : |
7039 if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
71- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ github.event.release.tag_name }}
40+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ github.event.release.tag_name }}
7241 elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
73- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :stable
42+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:stable
7443 else
7544 TAG=${{ env.FRONTEND_TAG }}
7645 fi
7746 echo "FRONTEND_TAG=${TAG}" >> $GITHUB_ENV
47+ - name : Docker Setup QEMU
48+ 49+
7850 - name : Set up Docker Buildx
79- 51+ 52+ with :
53+ platforms : linux/amd64,linux/arm64
54+ buildkitd-flags : " --allow-insecure-entitlement security.insecure"
8055
8156 - name : Login to Docker Hub
82- uses : docker/login-action@v2.1 .0
57+ uses : docker/login-action@v3.0 .0
8358 with :
8459 username : ${{ secrets.DOCKERHUB_USERNAME }}
8560 password : ${{ secrets.DOCKERHUB_TOKEN }}
86- - name : Downloading Web Source Code
87- uses : actions/download-artifact@v3
88- with :
89- name : web-src-code
61+
62+ - name : Check out the repo
63+ 9064
9165 - name : Build and Push Frontend to Docker Container Registry
92- uses : docker/build-push-action@v4.0 .0
66+ uses : docker/build-push-action@v5.1 .0
9367 with :
9468 context : .
9569 file : ./web/Dockerfile.web
@@ -105,33 +79,39 @@ jobs:
10579 runs-on : ubuntu-20.04
10680 needs : [branch_build_setup]
10781 env :
108- SPACE_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ needs.branch_build_setup.outputs.gh_branch_name }}
82+ SPACE_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ needs.branch_build_setup.outputs.gh_branch_name }}
10983 steps :
110- - name : Set Space Docker Tag
84+ - name : Set Space Docker Tag
11185 run : |
11286 if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
113- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }} :latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ github.event.release.tag_name }}
87+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ github.event.release.tag_name }}
11488 elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
115- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }} :stable
89+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:stable
11690 else
11791 TAG=${{ env.SPACE_TAG }}
11892 fi
11993 echo "SPACE_TAG=${TAG}" >> $GITHUB_ENV
94+
95+ - name : Docker Setup QEMU
96+ 97+
12098 - name : Set up Docker Buildx
121- 99+ 100+ with :
101+ platforms : linux/amd64,linux/arm64
102+ buildkitd-flags : " --allow-insecure-entitlement security.insecure"
122103
123104 - name : Login to Docker Hub
124- uses : docker/login-action@v2.1 .0
105+ uses : docker/login-action@v3.0 .0
125106 with :
126107 username : ${{ secrets.DOCKERHUB_USERNAME }}
127108 password : ${{ secrets.DOCKERHUB_TOKEN }}
128- - name : Downloading Space Source Code
129- uses : actions/download-artifact@v3
130- with :
131- name : space-src-code
109+
110+ - name : Check out the repo
111+ 132112
133113 - name : Build and Push Space to Docker Hub
134- uses : docker/build-push-action@v4.0 .0
114+ uses : docker/build-push-action@v5.1 .0
135115 with :
136116 context : .
137117 file : ./space/Dockerfile.space
@@ -147,36 +127,42 @@ jobs:
147127 runs-on : ubuntu-20.04
148128 needs : [branch_build_setup]
149129 env :
150- BACKEND_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ needs.branch_build_setup.outputs.gh_branch_name }}
130+ BACKEND_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ needs.branch_build_setup.outputs.gh_branch_name }}
151131 steps :
152- - name : Set Backend Docker Tag
132+ - name : Set Backend Docker Tag
153133 run : |
154134 if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
155- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ github.event.release.tag_name }}
135+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ github.event.release.tag_name }}
156136 elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
157- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }} :stable
137+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:stable
158138 else
159139 TAG=${{ env.BACKEND_TAG }}
160140 fi
161141 echo "BACKEND_TAG=${TAG}" >> $GITHUB_ENV
142+
143+ - name : Docker Setup QEMU
144+ 145+
162146 - name : Set up Docker Buildx
163- 147+ 148+ with :
149+ platforms : linux/amd64,linux/arm64
150+ buildkitd-flags : " --allow-insecure-entitlement security.insecure"
164151
165152 - name : Login to Docker Hub
166- uses : docker/login-action@v2.1 .0
153+ uses : docker/login-action@v3.0 .0
167154 with :
168155 username : ${{ secrets.DOCKERHUB_USERNAME }}
169156 password : ${{ secrets.DOCKERHUB_TOKEN }}
170- - name : Downloading Backend Source Code
171- uses : actions/download-artifact@v3
172- with :
173- name : backend-src-code
157+
158+ - name : Check out the repo
159+ 174160
175161 - name : Build and Push Backend to Docker Hub
176- uses : docker/build-push-action@v4.0 .0
162+ uses : docker/build-push-action@v5.1 .0
177163 with :
178- context : .
179- file : ./Dockerfile.api
164+ context : ./apiserver
165+ file : ./apiserver/ Dockerfile.api
180166 platforms : linux/amd64
181167 push : true
182168 tags : ${{ env.BACKEND_TAG }}
@@ -189,37 +175,42 @@ jobs:
189175 runs-on : ubuntu-20.04
190176 needs : [branch_build_setup]
191177 env :
192- PROXY_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ needs.branch_build_setup.outputs.gh_branch_name }}
178+ PROXY_TAG : ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ needs.branch_build_setup.outputs.gh_branch_name }}
193179 steps :
194- - name : Set Proxy Docker Tag
180+ - name : Set Proxy Docker Tag
195181 run : |
196182 if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then
197- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }} :latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }} :${{ github.event.release.tag_name }}
183+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ github.event.release.tag_name }}
198184 elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then
199- TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }} :stable
185+ TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:stable
200186 else
201187 TAG=${{ env.PROXY_TAG }}
202188 fi
203189 echo "PROXY_TAG=${TAG}" >> $GITHUB_ENV
190+
191+ - name : Docker Setup QEMU
192+ 193+
204194 - name : Set up Docker Buildx
205- 195+ 196+ with :
197+ platforms : linux/amd64,linux/arm64
198+ buildkitd-flags : " --allow-insecure-entitlement security.insecure"
206199
207200 - name : Login to Docker Hub
208- uses : docker/login-action@v2.1 .0
201+ uses : docker/login-action@v3.0 .0
209202 with :
210203 username : ${{ secrets.DOCKERHUB_USERNAME }}
211204 password : ${{ secrets.DOCKERHUB_TOKEN }}
212205
213- - name : Downloading Proxy Source Code
214- uses : actions/download-artifact@v3
215- with :
216- name : proxy-src-code
206+ - name : Check out the repo
207+ 217208
218209 - name : Build and Push Plane-Proxy to Docker Hub
219- uses : docker/build-push-action@v4.0 .0
210+ uses : docker/build-push-action@v5.1 .0
220211 with :
221- context : .
222- file : ./Dockerfile
212+ context : ./nginx
213+ file : ./nginx/ Dockerfile
223214 platforms : linux/amd64
224215 tags : ${{ env.PROXY_TAG }}
225216 push : true
0 commit comments