mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 21:54:00 +02:00
trying to optimize runtime of worklfow building the frontend containers
This commit is contained in:
6
.github/workflows/build-push-frontend.yml
vendored
6
.github/workflows/build-push-frontend.yml
vendored
@@ -26,8 +26,10 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: './web/package-lock.json'
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
run: npm ci
|
||||
working-directory: ./web
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
@@ -91,3 +93,5 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
@@ -4,16 +4,15 @@ FROM node:24-alpine AS deps
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production
|
||||
RUN npm ci --only=production && npm cache clean --force
|
||||
|
||||
FROM node:24-alpine AS build
|
||||
WORKDIR /app
|
||||
ARG VERSION
|
||||
ARG BASE_URL
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
RUN npm ci && npm cache clean --force
|
||||
|
||||
COPY . .
|
||||
RUN env PUBLIC_VERSION=${VERSION} BASE_URL=${BASE_URL} npm run build
|
||||
@@ -30,7 +29,8 @@ ENV PUBLIC_SSR_WEB=false
|
||||
COPY --from=build /app/build/ ./build/
|
||||
COPY package*.json ./
|
||||
COPY --chmod=755 mediamanager-frontend-startup.sh ./
|
||||
RUN npm ci --only=production
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
|
||||
EXPOSE 3000
|
||||
USER node
|
||||
|
||||
Reference in New Issue
Block a user