forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add docker release workflow (paradigmxyz#2985)
- Loading branch information
Showing
3 changed files
with
96 additions
and
1 deletion.
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,44 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
env: | ||
REPO_NAME: ${{ github.repository_owner }}/reth | ||
IMAGE_NAME: ${{ github.repository_owner }}/reth | ||
RUSTFLAGS: -D warnings | ||
CARGO_TERM_COLOR: always | ||
DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/reth | ||
DOCKER_USERNAME: ${{ github.actor }} | ||
|
||
jobs: | ||
build: | ||
name: build and push | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- name: Get latest version of stable Rust | ||
run: rustup update stable | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: Log in to Docker | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin | ||
- name: Set up Docker builder | ||
run: | | ||
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 | ||
docker buildx create --use --name cross-builder | ||
- name: Build and push image | ||
run: | | ||
cargo install cross | ||
env PROFILE=maxperf make docker-build-latest |
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,12 @@ | ||
# This image is meant to enable cross-architecture builds. | ||
# It assumes the reth binary has already been compiled for `$TARGETPLATFORM` and is | ||
# locatable in `./dist/bin/$TARGETARCH` | ||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
# Filled by docker buildx | ||
ARG TARGETARCH | ||
|
||
COPY ./dist/bin/$TARGETARCH/reth /usr/local/bin/reth | ||
|
||
EXPOSE 30303 30303/udp 9000 8545 8546 | ||
ENTRYPOINT ["/usr/local/bin/reth", "node"] |
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