From 3fb5581273e447e2c8bfcb00bad63dbda47b4ecc Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Fri, 23 May 2025 19:15:31 +0100 Subject: [PATCH] build: server cache improvements --- .github/workflows/docker-build.yml | 15 +++++++++++---- build/server.Dockerfile | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d1bccda2..dbbef749 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -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 diff --git a/build/server.Dockerfile b/build/server.Dockerfile index 0ce88b30..7d7b5ca6 100644 --- a/build/server.Dockerfile +++ b/build/server.Dockerfile @@ -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