mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-31 00:53:46 +00:00
chore(ci): introduce docker build cache (#234)
This commit is contained in:
parent
68308e3781
commit
fdb980ab06
2 changed files with 26 additions and 2 deletions
25
.github/workflows/docker.yml
vendored
25
.github/workflows/docker.yml
vendored
|
|
@ -2,7 +2,7 @@ name: "Push docker image to GAR"
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [taiko]
|
||||
branches: [ taiko ]
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
|
|
@ -38,9 +38,32 @@ jobs:
|
|||
type=ref,event=pr
|
||||
type=ref,event=tag
|
||||
type=sha
|
||||
|
||||
- name: Cache Go build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
enableCrossOsArchive: true
|
||||
path: |
|
||||
go-build-platforms
|
||||
key: ${{ runner.os }}-go_build-platforms
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go_build-platforms
|
||||
|
||||
- name: Inject cache into docker
|
||||
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
|
||||
with:
|
||||
cache-map: |
|
||||
{
|
||||
"go-build-platforms": "/root/.cache/go-build"
|
||||
}
|
||||
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ COPY go.sum /go-ethereum/
|
|||
RUN cd /go-ethereum && go mod download
|
||||
|
||||
ADD . /go-ethereum
|
||||
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
|
||||
cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
|
||||
|
||||
# Pull Geth into a second stage deploy alpine container
|
||||
FROM alpine:latest
|
||||
|
|
|
|||
Loading…
Reference in a new issue