From 5157e6b2290b99af6ad86f613f80b8a3e6001030 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Sep 2024 01:06:45 +0300 Subject: [PATCH] Add CI workflow for Docker build and Docker Compose setup for devnet --- .github/workflows/ci-build.yml | 33 +++++++++++++-------------------- docker-compose.yml | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 docker-compose.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index a4075c92a6..dc0d845782 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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 \ No newline at end of file + - name: Push Docker image + run: | + docker push your-dockerhub-username/geth:latest \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..60d4fcecd6 --- /dev/null +++ b/docker-compose.yml @@ -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 \ No newline at end of file