diff --git a/.github/workflows/deploy-hardhat.yml b/.github/workflows/deploy-hardhat.yml index b331ba2fb10f..dc0f2d3e8992 100644 --- a/.github/workflows/deploy-hardhat.yml +++ b/.github/workflows/deploy-hardhat.yml @@ -34,4 +34,18 @@ jobs: run: docker pull ghcr.io/san-est/go-ethereum-devops:9 - name: Running image container - run: docker run -d -name devnet -p 8545:8545 -v + run: | + docker run -d -name devnet -p 8545:8545 -v ${{ github.workspace }}/hardhat: /workspace/hardhat ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:9 + + - name: Deploy hardhat sample project + run: | + docker exec devnet npx hardhat compile --config /workspace/hardhat/hardhat.config.js + docker exec devnet npx hardhat run /workspace/hardhat/scripts/deploy.js --network development + + - name: Build a new docker image + run: | + docker commit devnet go-eth-hardhat:latest + docker tag go-eth-hardhat:latest ${{ env.REGISTRY }}/${{ github.repository_owner }}/go-eth-hardhat:latest + + - name: Push new image to ghcr.io + run: docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/go-eth-hardhat:latest \ No newline at end of file diff --git a/hardhat/Dockerfile b/hardhat/Dockerfile deleted file mode 100644 index 2fe3199082d2..000000000000 --- a/hardhat/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM node:22 -WORKDIR /app -COPY package.json . -COPY package-lock.json . -RUN npm install -COPY . . -EXPOSE 8545 -CMD [ "npx", "hardhat", "node" ] \ No newline at end of file diff --git a/hardhat/docker-compose.yml b/hardhat/docker-compose.yml deleted file mode 100644 index 18c8d7a9943a..000000000000 --- a/hardhat/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -#docker compose file to run both the image that we initially created with the first workflow and the dockerfile for hardhat -services: - devnet: - image: ghcr.io/san-est/go-ethereum-devops:9 - command: ["--dev", "--http", "--http.addr", "0.0.0.0", "--http.port", "8545", "--http.api", "eth,net,web3"] - ports: - - "8545:8545" - - hardhat: - build: . - depends_on: - - devnet - ports: - - "8545:8545" \ No newline at end of file