mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-15 08:23: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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [taiko]
|
branches: [ taiko ]
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
|
|
@ -38,9 +38,32 @@ jobs:
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=sha
|
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
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
context: .
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ COPY go.sum /go-ethereum/
|
||||||
RUN cd /go-ethereum && go mod download
|
RUN cd /go-ethereum && go mod download
|
||||||
|
|
||||||
ADD . /go-ethereum
|
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
|
# Pull Geth into a second stage deploy alpine container
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue