mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Add CI workflow for Docker build and Docker Compose setup for devnet
This commit is contained in:
parent
7622899be4
commit
5157e6b229
2 changed files with 37 additions and 20 deletions
33
.github/workflows/ci-build.yml
vendored
33
.github/workflows/ci-build.yml
vendored
|
|
@ -5,33 +5,26 @@ on:
|
||||||
types: [closed]
|
types: [closed]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
labels:
|
|
||||||
- 'CI:Build'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v2
|
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build the Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t dzivdzi/go-ethereum:${{ github.sha }} .
|
docker build . -t your-dockerhub-username/geth:latest
|
||||||
docker tag dzivdzi/go-ethereum:${{ github.sha }} dzivdzi/go-ethereum:latest
|
|
||||||
|
|
||||||
- name: Push the Docker image
|
- name: Push Docker image
|
||||||
run: |
|
run: |
|
||||||
docker push dzivdzi/go-ethereum:${{ github.sha }}
|
docker push your-dockerhub-username/geth:latest
|
||||||
docker push dzivdzi/go-ethereum:latest
|
|
||||||
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
geth-node:
|
||||||
|
image: your-dockerhub-username/geth:latest
|
||||||
|
container_name: geth-devnet
|
||||||
|
ports:
|
||||||
|
- "8545:8545"
|
||||||
|
- "30303:30303"
|
||||||
|
command: |
|
||||||
|
--dev
|
||||||
|
--http
|
||||||
|
--http.addr 0.0.0.0
|
||||||
|
--http.port 8545
|
||||||
|
--http.api personal,eth,net,web3
|
||||||
|
--allow-insecure-unlock
|
||||||
|
volumes:
|
||||||
|
- ./data:/root/.ethereum
|
||||||
|
networks:
|
||||||
|
- devnet
|
||||||
|
|
||||||
|
networks:
|
||||||
|
devnet:
|
||||||
|
driver: bridge
|
||||||
Loading…
Reference in a new issue