build: server cache improvements

This commit is contained in:
Rafael Taranto 2025-05-23 19:15:31 +01:00
parent 6c555c2a44
commit 3fb5581273
2 changed files with 12 additions and 5 deletions

View file

@ -57,6 +57,9 @@ jobs:
# Copy built admin UI to public directory
cp -r packages/admin-ui/build lamassu-server/public
# Copy Dockerfile to lamassu-server context
cp build/server.Dockerfile lamassu-server/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -69,17 +72,21 @@ jobs:
- name: Build and push server image
uses: docker/build-push-action@v5
with:
context: .
context: lamassu-server
push: true
target: l-s
file: ./build/server.Dockerfile
file: lamassu-server/server.Dockerfile
tags: ${{ env.DOCKERHUB_SERVER_REPO }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push admin server image
uses: docker/build-push-action@v5
with:
context: .
context: lamassu-server
push: true
target: l-a-s
file: ./build/server.Dockerfile
file: lamassu-server/server.Dockerfile
tags: ${{ env.DOCKERHUB_ADMIN_REPO }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -4,7 +4,7 @@ RUN apk add --no-cache bash libpq openssl ca-certificates
WORKDIR /lamassu-server
# Copy the pre-built production package from CI (with node_modules)
COPY lamassu-server/ ./
COPY . ./
FROM base AS l-s
RUN chmod +x /lamassu-server/bin/lamassu-server-entrypoint.sh