Add CI workflow for Docker build and Docker Compose setup for devnet

This commit is contained in:
unknown 2024-09-13 01:06:45 +03:00
parent 7622899be4
commit 5157e6b229
2 changed files with 37 additions and 20 deletions

View file

@ -5,33 +5,26 @@ on:
types: [closed]
branches:
- main
labels:
- 'CI:Build'
jobs:
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
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build the Docker image
run: |
docker build -t dzivdzi/go-ethereum:${{ github.sha }} .
docker tag dzivdzi/go-ethereum:${{ github.sha }} dzivdzi/go-ethereum:latest
- name: Build Docker image
run: |
docker build . -t your-dockerhub-username/geth:latest
- name: Push the Docker image
run: |
docker push dzivdzi/go-ethereum:${{ github.sha }}
docker push dzivdzi/go-ethereum:latest
- name: Push Docker image
run: |
docker push your-dockerhub-username/geth:latest

24
docker-compose.yml Normal file
View 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