Skip to content

Commit 9aa92da

Browse files
committed
chore(repo): fix local docker dev
1 parent 4a3c172 commit 9aa92da

22 files changed

Lines changed: 1757 additions & 696 deletions

.github/workflows/build-branch.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ jobs:
139139
branch_build_push_admin:
140140
name: Build-Push Admin Docker Image
141141
runs-on: ubuntu-22.04
142-
needs: [branch_build_setup]
142+
needs:
143+
- branch_build_setup
143144
steps:
144145
- name: Admin Build and Push
145146
uses: makeplane/actions/build-push@v1.0.0
@@ -152,7 +153,9 @@ jobs:
152153
docker-image-owner: makeplane
153154
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_admin }}
154155
build-context: .
155-
dockerfile-path: ./apps/admin/Dockerfile.admin
156+
dockerfile-path: ./Dockerfile.node
157+
build-args: |
158+
APP_SCOPE=admin
156159
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
157160
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
158161
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -161,7 +164,8 @@ jobs:
161164
branch_build_push_web:
162165
name: Build-Push Web Docker Image
163166
runs-on: ubuntu-22.04
164-
needs: [branch_build_setup]
167+
needs:
168+
- branch_build_setup
165169
steps:
166170
- name: Web Build and Push
167171
uses: makeplane/actions/build-push@v1.0.0
@@ -174,7 +178,9 @@ jobs:
174178
docker-image-owner: makeplane
175179
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_web }}
176180
build-context: .
177-
dockerfile-path: ./apps/web/Dockerfile.web
181+
dockerfile-path: ./Dockerfile.node
182+
build-args: |
183+
APP_SCOPE=web
178184
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
179185
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
180186
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -183,7 +189,8 @@ jobs:
183189
branch_build_push_space:
184190
name: Build-Push Space Docker Image
185191
runs-on: ubuntu-22.04
186-
needs: [branch_build_setup]
192+
needs:
193+
- branch_build_setup
187194
steps:
188195
- name: Space Build and Push
189196
uses: makeplane/actions/build-push@v1.0.0
@@ -196,7 +203,9 @@ jobs:
196203
docker-image-owner: makeplane
197204
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_space }}
198205
build-context: .
199-
dockerfile-path: ./apps/space/Dockerfile.space
206+
dockerfile-path: ./Dockerfile.node
207+
build-args: |
208+
APP_SCOPE=space
200209
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
201210
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
202211
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -205,7 +214,8 @@ jobs:
205214
branch_build_push_live:
206215
name: Build-Push Live Collaboration Docker Image
207216
runs-on: ubuntu-22.04
208-
needs: [branch_build_setup]
217+
needs:
218+
- branch_build_setup
209219
steps:
210220
- name: Live Build and Push
211221
uses: makeplane/actions/build-push@v1.0.0
@@ -227,7 +237,8 @@ jobs:
227237
branch_build_push_api:
228238
name: Build-Push API Server Docker Image
229239
runs-on: ubuntu-22.04
230-
needs: [branch_build_setup]
240+
needs:
241+
- branch_build_setup
231242
steps:
232243
- name: Backend Build and Push
233244
uses: makeplane/actions/build-push@v1.0.0
@@ -239,8 +250,8 @@ jobs:
239250
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
240251
docker-image-owner: makeplane
241252
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_backend }}
242-
build-context: ./apps/api
243-
dockerfile-path: ./apps/api/Dockerfile.api
253+
build-context: .
254+
dockerfile-path: ./Dockerfile.api
244255
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
245256
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
246257
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
@@ -249,7 +260,8 @@ jobs:
249260
branch_build_push_proxy:
250261
name: Build-Push Proxy Docker Image
251262
runs-on: ubuntu-22.04
252-
needs: [branch_build_setup]
263+
needs:
264+
- branch_build_setup
253265
steps:
254266
- name: Proxy Build and Push
255267
uses: makeplane/actions/build-push@v1.0.0
@@ -368,15 +380,13 @@ jobs:
368380
name: Build Release
369381
runs-on: ubuntu-22.04
370382
needs:
371-
[
372-
branch_build_setup,
373-
branch_build_push_admin,
374-
branch_build_push_web,
375-
branch_build_push_space,
376-
branch_build_push_live,
377-
branch_build_push_api,
378-
branch_build_push_proxy,
379-
]
383+
- branch_build_setup
384+
- branch_build_push_admin
385+
- branch_build_push_web
386+
- branch_build_push_space
387+
- branch_build_push_live
388+
- branch_build_push_api
389+
- branch_build_push_proxy
380390
env:
381391
REL_VERSION: ${{ needs.branch_build_setup.outputs.release_version }}
382392
steps:
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)