Skip to content

Commit aac0f29

Browse files
build: try to build web separately.
1 parent ee494a5 commit aac0f29

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/build-and-push.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ jobs:
9090
registry: ${{ secrets.FIT2CLOUD_REGISTRY_HOST }}
9191
username: ${{ secrets.FIT2CLOUD_REGISTRY_USERNAME }}
9292
password: ${{ secrets.FIT2CLOUD_REGISTRY_PASSWORD }}
93+
- name: Build Web
94+
run: |
95+
docker buildx build --target web-build --output type=local,dest=./web-build-output . -f installer/Dockerfile
96+
rm -rf ./ui
97+
cp -r ./web-build-output/ui ./
98+
rm -rf ./web-build-output
9399
- name: Docker Buildx (build-and-push)
94100
run: |
95101
sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free -m
@@ -150,6 +156,12 @@ jobs:
150156
with:
151157
username: ${{ secrets.DOCKERHUB_USERNAME }}
152158
password: ${{ secrets.DOCKERHUB_TOKEN }}
159+
- name: Build Web
160+
run: |
161+
docker buildx build --target web-build --output type=local,dest=./web-build-output . -f installer/Dockerfile
162+
rm -rf ./ui
163+
cp -r ./web-build-output/ui ./
164+
rm -rf ./web-build-output
153165
- name: Docker Buildx (build-and-push)
154166
run: |
155167
sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free -m

installer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:24-alpine AS web-build
22
COPY ui ui
3-
RUN cd ui && \
3+
RUN cd ui && ls -la && if [ -d "dist" ]; then exit 0; fi && \
44
npm install --prefer-offline --no-audit && \
55
npm install -D concurrently && \
66
NODE_OPTIONS="--max-old-space-size=4096" npx concurrently "npm run build" "npm run build-chat" && \

0 commit comments

Comments
 (0)