diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76ab6cf18e7db51c404a4002ca87018ed2442572..7cc7322187d17497a04c557e7cbb30c373c7362a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,4 +76,11 @@ jobs: steps: - uses: actions/checkout@v3 - run: git submodule update --init --recursive --force + + # In this step, this action saves a list of existing images, + # the cache is created without them in the post run. + # It also restores the cache if it exists. + - uses: satackey/action-docker-layer-caching@v0.0.11 + continue-on-error: false + - run: docker build . diff --git a/Dockerfile b/Dockerfile index a9836e39f3f9329d2609e787eafbc3e57a7bf83d..52f6848a827a643f39f7fd61b1718c9745e51ae1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,13 @@ FROM docker.io/library/golang:1.18-alpine3.15 AS builder RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++ WORKDIR /app + +# Get dependencies - will also be cached if we won't change go.mod/go.sum +COPY go.mod . +COPY go.sum . +RUN go mod download + + ADD . . RUN make erigon rpcdaemon integration sentry txpool downloader hack observer db-tools