-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(relayer): Dockerfile + github action on merge to main (#316)
- Loading branch information
1 parent
5f4723f
commit 0052673
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "Push docker image to GCR" | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "packages/relayer/**" | ||
|
||
jobs: | ||
push-docker-image: | ||
name: Build and push docker image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: gcr.io | ||
username: _json_key | ||
password: ${{ secrets.GCR_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: | | ||
gcr.io/evmchain/relayer | ||
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 | ||
context: packages/relayer | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM golang:1.19.3 as builder | ||
|
||
RUN apt install git curl | ||
|
||
RUN git clone --depth 1 https://github.com/taikoxyz/taiko-mono /taiko-mono | ||
|
||
WORKDIR /taiko-mono/packages/relayer | ||
|
||
RUN go mod download | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o ./bin/relayer cmd/main.go | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk add --no-cache ca-certificates | ||
|
||
COPY --from=builder /taiko-mono/packages/relayer/bin/relayer /usr/local/bin/ | ||
|
||
ENTRYPOINT ["relayer"] |