fix: update Dockerfile to clone wokwi-libs directly and streamline build process
This commit is contained in:
parent
9c376e70d4
commit
22de9173ba
|
|
@ -20,8 +20,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,21 @@ FROM node:20 AS frontend-builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Clone wokwi-libs fresh from upstream to avoid stale submodule pointers.
|
||||||
|
# git is pre-installed in the node:20 Debian image.
|
||||||
|
RUN git clone --depth=1 https://github.com/wokwi/avr8js.git wokwi-libs/avr8js \
|
||||||
|
&& git clone --depth=1 https://github.com/wokwi/rp2040js.git wokwi-libs/rp2040js \
|
||||||
|
&& git clone --depth=1 https://github.com/wokwi/wokwi-elements.git wokwi-libs/wokwi-elements
|
||||||
|
|
||||||
# Build avr8js
|
# Build avr8js
|
||||||
COPY wokwi-libs/avr8js/ wokwi-libs/avr8js/
|
|
||||||
WORKDIR /app/wokwi-libs/avr8js
|
WORKDIR /app/wokwi-libs/avr8js
|
||||||
RUN npm install && npm run build --if-present
|
RUN npm install && npm run build --if-present
|
||||||
|
|
||||||
# Build rp2040js (submodule may be empty on CI; skip if no package.json)
|
# Build rp2040js (may have no build script on some commits)
|
||||||
COPY wokwi-libs/rp2040js/ wokwi-libs/rp2040js/
|
|
||||||
WORKDIR /app/wokwi-libs/rp2040js
|
WORKDIR /app/wokwi-libs/rp2040js
|
||||||
RUN if [ -f package.json ]; then npm install && npm run build --if-present; fi
|
RUN npm install && npm run build --if-present
|
||||||
|
|
||||||
# Build wokwi-elements
|
# Build wokwi-elements
|
||||||
COPY wokwi-libs/wokwi-elements/ wokwi-libs/wokwi-elements/
|
|
||||||
WORKDIR /app/wokwi-libs/wokwi-elements
|
WORKDIR /app/wokwi-libs/wokwi-elements
|
||||||
RUN npm install && npm run build --if-present
|
RUN npm install && npm run build --if-present
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue