Skip to content

Commit

Permalink
change docker trigger branch for test 6
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed May 7, 2024
1 parent 3ff15e0 commit 47bf889
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/docker_amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Push docker image to GAR"

on:
push:
branches: [taiko]
tags:
- "v*"

jobs:
push-docker-image:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to GAR
uses: docker/login-action@v2
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
us-docker.pkg.dev/evmchain/images/taiko-geth
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=sha
- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,25 @@ jobs:
- name: Go Build Cache for Docker
uses: actions/cache@v3
with:
enable-dependency-cache: true
path: go-build-cache
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
key: arm64_go_cache-${{ hashFiles('Dockerfile') }}

- name: inject go-build-cache into docker
# v1 was composed of two actions: "inject" and "extract".
# v2 is unified to a single action.
uses: reproducible-containers/[email protected]
with:
cache-source: go-build-cache
cache-map: |
"go-build-cache": "/tmp/.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
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ RUN apk add --no-cache gcc musl-dev linux-headers git
# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod /go-ethereum/
COPY go.sum /go-ethereum/
RUN --mount=type=cache,target=/tmp/.cache/go-build \
cd /go-ethereum && go mod download
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN --mount=type=cache,target=/tmp/.cache/go-build \
Expand Down

0 comments on commit 47bf889

Please sign in to comment.