File tree Expand file tree Collapse file tree 12 files changed +69
-16
lines changed Expand file tree Collapse file tree 12 files changed +69
-16
lines changed Original file line number Diff line number Diff line change 5959 platforms : linux/amd64,linux/arm64
6060 tags : ${{ steps.docker-meta.outputs.tags }}
6161 labels : ${{ steps.docker-meta.outputs.labels }}
62+ cache-from : type=gha
63+ cache-to : type=gha,mode=max
6264 build-args : |
6365 COMMIT_SHA=${{ github.sha }}
6466 VERSION=${{ steps.meta.outputs.version }}
Original file line number Diff line number Diff line change 5959 platforms : linux/amd64,linux/arm64
6060 tags : ${{ steps.docker-meta.outputs.tags }}
6161 labels : ${{ steps.docker-meta.outputs.labels }}
62+ cache-from : type=gha
63+ cache-to : type=gha,mode=max
6264 build-args : |
6365 COMMIT_SHA=${{ github.sha }}
6466 VERSION=${{ steps.meta.outputs.version }}
Original file line number Diff line number Diff line change @@ -187,6 +187,8 @@ jobs:
187187 platforms : linux/amd64,linux/arm64
188188 tags : ${{ steps.docker-meta.outputs.tags }}
189189 labels : ${{ steps.docker-meta.outputs.labels }}
190+ cache-from : type=gha
191+ cache-to : type=gha,mode=max
190192 build-args : |
191193 COMMIT_SHA=${{ github.sha }}
192194 VERSION=${{ steps.meta.outputs.version }}
Original file line number Diff line number Diff line change 6060 platforms : linux/amd64,linux/arm64
6161 tags : ${{ steps.docker-meta.outputs.tags }}
6262 labels : ${{ steps.docker-meta.outputs.labels }}
63+ cache-from : type=gha
64+ cache-to : type=gha,mode=max
6365 build-args : |
6466 COMMIT_SHA=${{ github.sha }}
6567 VERSION=${{ steps.meta.outputs.version }}
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ RUN echo "commit sha: ${COMMIT_SHA}"
55# Set the working directory
66WORKDIR $GOPATH/src/github.com/diggerhq/digger
77
8+ # Copy go.mod/go.sum first for better layer caching
9+ COPY go.mod go.sum ./
10+ RUN go mod download
11+
812# Copy all required source, blacklist files that are not required through `.dockerignore`
913COPY . .
1014
@@ -16,7 +20,9 @@ RUN go version
1620# https://github.com/ethereum/go-ethereum/issues/2738
1721# Build static binary "-getmode=vendor" does not work with go-ethereum
1822
19- RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o backend_exe ./backend/
23+ RUN --mount=type=cache,target=/root/.cache/go-build \
24+ --mount=type=cache,target=/go/pkg/mod \
25+ go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o backend_exe ./backend/
2026
2127# Multi-stage build will just copy the binary to an alpine image.
2228FROM ubuntu:24.04 as runner
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ RUN echo "commit sha: ${COMMIT_SHA}"
55# Set the working directory
66WORKDIR $GOPATH/src/github.com/diggerhq/digger
77
8+ # Copy go.mod/go.sum first for better layer caching
9+ COPY go.mod go.sum ./
10+ RUN go mod download
11+
812# Copy all required source, blacklist files that are not required through `.dockerignore`
913COPY . .
1014
@@ -16,7 +20,9 @@ RUN go version
1620# https://github.com/ethereum/go-ethereum/issues/2738
1721# Build static binary "-getmode=vendor" does not work with go-ethereum
1822
19- RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o backend_exe ./ee/backend/
23+ RUN --mount=type=cache,target=/root/.cache/go-build \
24+ --mount=type=cache,target=/go/pkg/mod \
25+ go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o backend_exe ./ee/backend/
2026
2127# Multi-stage build will just copy the binary to an alpine image.
2228FROM ubuntu:24.04 as runner
Original file line number Diff line number Diff line change @@ -5,10 +5,16 @@ RUN echo "commit sha: ${COMMIT_SHA}"
55# Set the working directory
66WORKDIR $GOPATH/src/github.com/diggerhq/digger
77
8+ # Copy go.mod/go.sum first for better layer caching
9+ COPY go.mod go.sum ./
10+ RUN go mod download
11+
812# Copy all required source, blacklist files that are not required through `.dockerignore`
913COPY . .
1014
11- RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o projects_refresh_exe ./background/projects-refresh-service
15+ RUN --mount=type=cache,target=/root/.cache/go-build \
16+ --mount=type=cache,target=/go/pkg/mod \
17+ go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o projects_refresh_exe ./background/projects-refresh-service
1218
1319# Multi-stage build will just copy the binary to an alpine image.
1420FROM ubuntu:24.04 as runner
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ RUN echo "commit sha: ${COMMIT_SHA}"
55# Set the working directory
66WORKDIR $GOPATH/src/github.com/diggerhq/digger
77
8+ # Copy go.mod/go.sum first for better layer caching
9+ COPY go.mod go.sum ./
10+ RUN go mod download
11+
812# Copy all required source, blacklist files that are not required through `.dockerignore`
913COPY . .
1014
@@ -16,7 +20,9 @@ RUN go version
1620# https://github.com/ethereum/go-ethereum/issues/2738
1721# Build static binary "-getmode=vendor" does not work with go-ethereum
1822
19- RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o drift_exe ./drift/
23+ RUN --mount=type=cache,target=/root/.cache/go-build \
24+ --mount=type=cache,target=/go/pkg/mod \
25+ go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o drift_exe ./drift/
2026
2127# Multi-stage build will just copy the binary to an alpine image.
2228FROM ubuntu:24.04 AS runner
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ RUN echo "commit sha: ${COMMIT_SHA}"
55# Set the working directory
66WORKDIR $GOPATH/src/github.com/diggerhq/digger
77
8+ # Copy go.mod/go.sum first for better layer caching
9+ COPY go.mod go.sum ./
10+ RUN go mod download
11+
812# Copy all required source, blacklist files that are not required through `.dockerignore`
913COPY . .
1014
@@ -16,7 +20,9 @@ RUN go version
1620# https://github.com/ethereum/go-ethereum/issues/2738
1721# Build static binary "-getmode=vendor" does not work with go-ethereum
1822
19- RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o tasks_exe ./backend/tasks
23+ RUN --mount=type=cache,target=/root/.cache/go-build \
24+ --mount=type=cache,target=/go/pkg/mod \
25+ go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o tasks_exe ./backend/tasks
2026
2127# Multi-stage build will just copy the binary to an alpine image.
2228FROM ubuntu:24.04 as runner
Original file line number Diff line number Diff line change @@ -4,30 +4,33 @@ FROM node:20-alpine AS builder
44WORKDIR /app
55
66# Copy package files
7- COPY ui/package.json ./
7+ COPY ui/package.json ui/package-lock.json ./
88
99# Install dependencies first
1010# npm will automatically install correct platform-specific binaries (amd64 or arm64)
11- RUN npm install && \
11+ RUN --mount=type=cache,target=/root/.npm \
12+ npm ci && \
1213 npm cache clean --force
1314
1415# Copy source code (node_modules excluded via .dockerignore)
1516COPY ui/ ./
1617
1718# Build the application (with node adapter)
18- RUN npm run build
19+ RUN --mount=type=cache,target=/root/.npm \
20+ npm run build
1921
2022# Production stage
2123FROM node:20-alpine
2224
2325WORKDIR /app
2426
2527# Copy package file
26- COPY ui/package.json ./
28+ COPY ui/package.json ui/package-lock.json ./
2729
2830# Install production dependencies only
2931# npm will automatically install correct platform-specific binaries (amd64 or arm64)
30- RUN npm install --omit=dev && \
32+ RUN --mount=type=cache,target=/root/.npm \
33+ npm ci --omit=dev && \
3134 npm cache clean --force
3235
3336# Copy built application and server entry from builder
You can’t perform that action at this time.
0 commit comments