go-ethereum/.github/workflows/build-hardhat-project.yaml
2023-11-15 16:12:01 +02:00

55 lines
1.4 KiB
YAML

name: Hardhat Deploy and Test
on:
pull_request:
branches:
- master
types:
- labeled
jobs:
deploy_hardhat_project:
if: ${{ github.event.label.name == 'CI:Deploy'}}
name: Build And Push GETH Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN}}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Run geth devnet
run: docker run --name go-ethereum -p 8545:8545 -p 30303:30303 -d anglyuboslav/geth --dev --http --http.addr 0.0.0.0
- name: Install dependencies
run: |
cd hardhat
npm install -y
npm install --save-dev hardhat -y
npm install --save-dev @nomicfoundation/hardhat-toolbox -y
- name: Deploy Hardhat project
run: |
cd hardhat
npx hardhat run scripts/deploy.js --network localhost
- name: Run tests
run: |
cd hardhat
npx hardhat test --network localhost
- name: Create devnet geth image and push to Dockerhub
run: |
./create_image.sh
docker push anglyuboslav/geth-smart-con