forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
containerize w/ github action to build and push to ghcr (#3)
- Loading branch information
1 parent
c7715ff
commit 1172ff4
Showing
4 changed files
with
65 additions
and
6 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,26 @@ | ||
build-and-publish-latest: | ||
on: | ||
push: | ||
branches: | ||
- astria # Running this job only for astria branch | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 # Checking out the repo | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "^1.20.x" # The Go version to download (if necessary) and use. | ||
- run: go version | ||
|
||
- name: Log in to registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
|
||
# TODO - build for amd64 and arm64? | ||
- name: Build and Publish latest Docker image | ||
uses: TCPShield/gp-docker-action@1.1.13 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages | ||
image-name: ghcr.io/astriaorg/go-ethereum # Provide only Docker image name, tag will be automatically set to latest | ||
# Pass some additional arguments to the docker build command | ||
# FIXME - version needs to be autoincrement, probably from git tags? | ||
custom-args: --build-arg COMMIT=${GITHUB_SHA} --build-arg VERSION=0.1.0 --build-arg BUILDNUM=${GITHUB_RUN_NUMBER} |
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
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
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 |
---|---|---|
@@ -1,15 +1,46 @@ | ||
This package provides a gRPC server as an entrypoint to the EVM. | ||
|
||
Helpful commands (MacOS): | ||
## Build and run from source: | ||
```bash | ||
# install necessary dependencies | ||
brew install leveldb | ||
|
||
# build geth | ||
make geth | ||
|
||
# TODO - run beacon? | ||
|
||
# run geth | ||
./build/bin/geth --goerli --grpc --grpc.addr "[::1]" --grpc.port 50051 | ||
./build/bin/geth --goerli --grpc --grpc.addr "0.0.0.0" --grpc.port 50051 | ||
``` | ||
|
||
### Running with remote Docker image: | ||
```bash | ||
docker run --rm \ | ||
-p 8545:8545 -p 30303:30303 -p 50051:50051 \ | ||
ghcr.io/astriaorg/go-ethereum --goerli \ | ||
--grpc --grpc.addr "0.0.0.0" --grpc.port 50051 | ||
``` | ||
|
||
### Local Docker workflow: | ||
```bash | ||
# build local docker image | ||
docker build \ | ||
--build-arg COMMIT=$(git rev-parse HEAD) \ | ||
--build-arg VERSION=0.1 \ | ||
--build-arg BUILDNUM=1 \ | ||
--tag ghcr.io/astriaorg/go-ethereum:local . | ||
|
||
# run local docker image | ||
docker run --rm \ | ||
-p 8545:8545 -p 30303:30303 -p 50051:50051 \ | ||
ghcr.io/astriaorg/go-ethereum:local --goerli \ | ||
--grpc --grpc.addr "0.0.0.0" --grpc.port 50051 | ||
|
||
# build and push to remote from local (as opposed to gh action) | ||
docker build \ | ||
--build-arg COMMIT=$(git rev-parse HEAD) \ | ||
--build-arg VERSION=0.1 \ | ||
--build-arg BUILDNUM=1 \ | ||
--tag ghcr.io/astriaorg/go-ethereum:latest . | ||
echo $CR_PAT | docker login ghcr.io -u astriaorg --password-stdin | ||
docker push ghcr.io/astriaorg/go-ethereum:latest | ||
``` |