Skip to content

Commit d8eaf20

Browse files
committed
chore(repo): fix local docker dev
1 parent 0fe7da6 commit d8eaf20

23 files changed

Lines changed: 1782 additions & 710 deletions

.github/workflows/build-branch.yml

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ jobs:
135135
branch_build_push_admin:
136136
name: Build-Push Admin Docker Image
137137
runs-on: ubuntu-22.04
138-
needs: [branch_build_setup]
138+
needs:
139+
- branch_build_setup
139140
steps:
140141
- name: Admin Build and Push
141142
uses: makeplane/actions/build-push@v1.0.0
@@ -148,7 +149,9 @@ jobs:
148149
docker-image-owner: makeplane
149150
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_admin }}
150151
build-context: .
151-
dockerfile-path: ./apps/admin/Dockerfile.admin
152+
dockerfile-path: ./Dockerfile.node
153+
build-args: |
154+
APP_SCOPE=admin
152155
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
153156
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
154157
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -157,7 +160,8 @@ jobs:
157160
branch_build_push_web:
158161
name: Build-Push Web Docker Image
159162
runs-on: ubuntu-22.04
160-
needs: [branch_build_setup]
163+
needs:
164+
- branch_build_setup
161165
steps:
162166
- name: Web Build and Push
163167
uses: makeplane/actions/build-push@v1.0.0
@@ -170,7 +174,9 @@ jobs:
170174
docker-image-owner: makeplane
171175
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_web }}
172176
build-context: .
173-
dockerfile-path: ./apps/web/Dockerfile.web
177+
dockerfile-path: ./Dockerfile.node
178+
build-args: |
179+
APP_SCOPE=web
174180
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
175181
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
176182
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -179,7 +185,8 @@ jobs:
179185
branch_build_push_space:
180186
name: Build-Push Space Docker Image
181187
runs-on: ubuntu-22.04
182-
needs: [branch_build_setup]
188+
needs:
189+
- branch_build_setup
183190
steps:
184191
- name: Space Build and Push
185192
uses: makeplane/actions/build-push@v1.0.0
@@ -192,7 +199,9 @@ jobs:
192199
docker-image-owner: makeplane
193200
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_space }}
194201
build-context: .
195-
dockerfile-path: ./apps/space/Dockerfile.space
202+
dockerfile-path: ./Dockerfile.node
203+
build-args: |
204+
APP_SCOPE=space
196205
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
197206
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
198207
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -201,7 +210,8 @@ jobs:
201210
branch_build_push_live:
202211
name: Build-Push Live Collaboration Docker Image
203212
runs-on: ubuntu-22.04
204-
needs: [branch_build_setup]
213+
needs:
214+
- branch_build_setup
205215
steps:
206216
- name: Live Build and Push
207217
uses: makeplane/actions/build-push@v1.0.0
@@ -223,7 +233,8 @@ jobs:
223233
branch_build_push_api:
224234
name: Build-Push API Server Docker Image
225235
runs-on: ubuntu-22.04
226-
needs: [branch_build_setup]
236+
needs:
237+
- branch_build_setup
227238
steps:
228239
- name: Backend Build and Push
229240
uses: makeplane/actions/build-push@v1.0.0
@@ -235,8 +246,8 @@ jobs:
235246
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
236247
docker-image-owner: makeplane
237248
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_backend }}
238-
build-context: ./apps/api
239-
dockerfile-path: ./apps/api/Dockerfile.api
249+
build-context: .
250+
dockerfile-path: ./Dockerfile.api
240251
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
241252
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
242253
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -245,7 +256,8 @@ jobs:
245256
branch_build_push_proxy:
246257
name: Build-Push Proxy Docker Image
247258
runs-on: ubuntu-22.04
248-
needs: [branch_build_setup]
259+
needs:
260+
- branch_build_setup
249261
steps:
250262
- name: Proxy Build and Push
251263
uses: makeplane/actions/build-push@v1.0.0
@@ -268,15 +280,14 @@ jobs:
268280
if: ${{ needs.branch_build_setup.outputs.aio_build == 'true' }}
269281
name: Build-Push AIO Docker Image
270282
runs-on: ubuntu-22.04
271-
needs: [
272-
branch_build_setup,
273-
branch_build_push_admin,
274-
branch_build_push_web,
275-
branch_build_push_space,
276-
branch_build_push_live,
277-
branch_build_push_api,
278-
branch_build_push_proxy
279-
]
283+
needs:
284+
- branch_build_setup
285+
- branch_build_push_admin
286+
- branch_build_push_web
287+
- branch_build_push_space
288+
- branch_build_push_live
289+
- branch_build_push_api
290+
- branch_build_push_proxy
280291
steps:
281292
- name: Checkout Files
282293
uses: actions/checkout@v4
@@ -285,7 +296,7 @@ jobs:
285296
id: prepare_aio_assets
286297
run: |
287298
cd deployments/aio/community
288-
299+
289300
if [ "${{ needs.branch_build_setup.outputs.build_type }}" == "Release" ]; then
290301
aio_version=${{ needs.branch_build_setup.outputs.release_version }}
291302
else
@@ -324,7 +335,14 @@ jobs:
324335
upload_build_assets:
325336
name: Upload Build Assets
326337
runs-on: ubuntu-22.04
327-
needs: [branch_build_setup, branch_build_push_admin, branch_build_push_web, branch_build_push_space, branch_build_push_live, branch_build_push_api, branch_build_push_proxy]
338+
needs:
339+
- branch_build_setup
340+
- branch_build_push_admin
341+
- branch_build_push_web
342+
- branch_build_push_space
343+
- branch_build_push_live
344+
- branch_build_push_api
345+
- branch_build_push_proxy
328346
steps:
329347
- name: Checkout Files
330348
uses: actions/checkout@v4
@@ -358,15 +376,13 @@ jobs:
358376
name: Build Release
359377
runs-on: ubuntu-22.04
360378
needs:
361-
[
362-
branch_build_setup,
363-
branch_build_push_admin,
364-
branch_build_push_web,
365-
branch_build_push_space,
366-
branch_build_push_live,
367-
branch_build_push_api,
368-
branch_build_push_proxy,
369-
]
379+
- branch_build_setup
380+
- branch_build_push_admin
381+
- branch_build_push_web
382+
- branch_build_push_space
383+
- branch_build_push_live
384+
- branch_build_push_api
385+
- branch_build_push_proxy
370386
env:
371387
REL_VERSION: ${{ needs.branch_build_setup.outputs.release_version }}
372388
steps:
@@ -397,4 +413,3 @@ jobs:
397413
${{ github.workspace }}/deployments/cli/community/docker-compose.yml
398414
${{ github.workspace }}/deployments/cli/community/variables.env
399415
${{ github.workspace }}/deployments/swarm/community/swarm.sh
400-
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Docker AIO build and smoke test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- "preview"
8+
paths:
9+
- "apps/web/**"
10+
- "apps/space/**"
11+
- "apps/admin/**"
12+
- "apps/live/**"
13+
- "packages/**"
14+
- "turbo.json"
15+
- "pnpm-lock.yaml"
16+
- "pnpm-workspace.yaml"
17+
- "Dockerfile.node"
18+
- "Dockerfile.api"
19+
- "Dockerfile.aio"
20+
- "docker-bake.hcl"
21+
- ".github/workflows/docker-smoke-aio.yml"
22+
push:
23+
branches:
24+
- "preview"
25+
paths:
26+
- "apps/web/**"
27+
- "apps/space/**"
28+
- "apps/admin/**"
29+
- "apps/live/**"
30+
- "packages/**"
31+
- "turbo.json"
32+
- "pnpm-lock.yaml"
33+
- "pnpm-workspace.yaml"
34+
- "Dockerfile.node"
35+
- "Dockerfile.api"
36+
- "Dockerfile.aio"
37+
- "docker-bake.hcl"
38+
- ".github/workflows/docker-smoke-aio.yml"
39+
40+
concurrency:
41+
group: aio-${{ github.workflow }}-${{ github.ref }}
42+
cancel-in-progress: false
43+
44+
jobs:
45+
determine-aio:
46+
name: Determine if AIO needed
47+
runs-on: ubuntu-latest
48+
outputs:
49+
aio_needed: ${{ steps.build-flag.outputs.aio_needed }}
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Detect changed paths
57+
id: changes
58+
uses: dorny/paths-filter@v3
59+
with:
60+
filters: |
61+
web:
62+
- 'apps/web/**'
63+
space:
64+
- 'apps/space/**'
65+
admin:
66+
- 'apps/admin/**'
67+
live:
68+
- 'apps/live/**'
69+
common:
70+
- 'packages/**'
71+
- 'turbo.json'
72+
- 'pnpm-lock.yaml'
73+
- 'pnpm-workspace.yaml'
74+
- 'Dockerfile.node'
75+
- 'Dockerfile.api'
76+
- 'Dockerfile.aio'
77+
- 'docker-bake.hcl'
78+
- '.github/workflows/docker-smoke-aio.yml'
79+
80+
- name: Compute AIO flag
81+
id: build-flag
82+
uses: actions/github-script@v7
83+
with:
84+
script: |
85+
const anyCommon = '${{ steps.changes.outputs.common }}' === 'true';
86+
const changedWeb = '${{ steps.changes.outputs.web }}' === 'true';
87+
const changedSpace = '${{ steps.changes.outputs.space }}' === 'true';
88+
const changedAdmin = '${{ steps.changes.outputs.admin }}' === 'true';
89+
const changedLive = '${{ steps.changes.outputs.live }}' === 'true';
90+
const aioNeeded = anyCommon || changedWeb || changedSpace || changedAdmin || changedLive;
91+
core.setOutput('aio_needed', String(aioNeeded));
92+
93+
aio_smoke:
94+
name: Build and smoke test AIO
95+
runs-on: ubuntu-latest
96+
needs: determine-aio
97+
if: ${{ needs.determine-aio.outputs.aio_needed == 'true' }}
98+
timeout-minutes: 30
99+
100+
steps:
101+
- name: Checkout repository
102+
uses: actions/checkout@v4
103+
with:
104+
fetch-depth: 0
105+
106+
- name: Show Docker version
107+
run: |
108+
docker version
109+
docker info
110+
111+
- name: Set up Docker Buildx
112+
uses: docker/setup-buildx-action@v3
113+
114+
- name: Build AIO image with bake (load into local daemon)
115+
run: |
116+
docker buildx bake -f "./docker-bake.hcl" --load aio
117+
118+
- name: Run AIO smoke script
119+
run: |
120+
chmod +x "scripts/smoke-aio.sh"
121+
"scripts/smoke-aio.sh"

0 commit comments

Comments
 (0)