fix: update Dockerfile to clone wokwi-libs directly and streamline build process
parent
9c376e70d4
commit
22de9173ba
|
|
@ -20,8 +20,6 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
|
|
|||
|
|
@ -3,18 +3,21 @@ FROM node:20 AS frontend-builder
|
|||
|
||||
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
|
||||
COPY wokwi-libs/avr8js/ wokwi-libs/avr8js/
|
||||
WORKDIR /app/wokwi-libs/avr8js
|
||||
RUN npm install && npm run build --if-present
|
||||
|
||||
# Build rp2040js (submodule may be empty on CI; skip if no package.json)
|
||||
COPY wokwi-libs/rp2040js/ wokwi-libs/rp2040js/
|
||||
# Build rp2040js (may have no build script on some commits)
|
||||
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
|
||||
COPY wokwi-libs/wokwi-elements/ wokwi-libs/wokwi-elements/
|
||||
WORKDIR /app/wokwi-libs/wokwi-elements
|
||||
RUN npm install && npm run build --if-present
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue