fix: checkout submodules and use robust docker build stage
parent
f071830ab5
commit
8f0c431f8d
|
|
@ -20,6 +20,8 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Log in to GitHub Container Registry (GHCR)
|
||||
uses: docker/login-action@v3
|
||||
|
|
|
|||
|
|
@ -1,28 +1,33 @@
|
|||
# ---- Stage 1: Build frontend and wokwi-libs ----
|
||||
FROM node:20-slim AS frontend-builder
|
||||
FROM node:20 AS frontend-builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json for metadata generation
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
RUN npm install --ignore-scripts
|
||||
|
||||
# Build avr8js
|
||||
COPY wokwi-libs/avr8js/ wokwi-libs/avr8js/
|
||||
WORKDIR /app/wokwi-libs/avr8js
|
||||
RUN npm install && npm run build
|
||||
RUN npm install --ignore-scripts && npm run build
|
||||
|
||||
# Build rp2040js
|
||||
COPY wokwi-libs/rp2040js/ wokwi-libs/rp2040js/
|
||||
WORKDIR /app/wokwi-libs/rp2040js
|
||||
RUN npm install --ignore-scripts && npm run build
|
||||
|
||||
# Build wokwi-elements
|
||||
COPY wokwi-libs/wokwi-elements/ wokwi-libs/wokwi-elements/
|
||||
WORKDIR /app/wokwi-libs/wokwi-elements
|
||||
RUN npm install && npm run build
|
||||
RUN npm install --ignore-scripts && npm run build
|
||||
|
||||
# Build frontend
|
||||
WORKDIR /app
|
||||
COPY frontend/ frontend/
|
||||
COPY scripts/ scripts/
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install \
|
||||
RUN npm install --ignore-scripts \
|
||||
&& npm run build
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue