go-ethereum/.github/workflows/ci-deploy.yml
Radostina Lyubomirova 916827d64b please work
2025-06-03 21:48:16 +03:00

50 lines
1.6 KiB
YAML

name: Deploy Contracts to Devnet
on:
pull_request:
types: [closed]
jobs:
deploy_contracts:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Deploy')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Start Geth devnet container
run: |
docker run -d --name geth-devnet -p 8545:8545 \
ghcr.io/${{ github.repository_owner }}/go-ethereum:dev-latest \
geth --http --http.addr 0.0.0.0 --http.port 8545 --http.api eth,net,web3 --dev
- name: Wait for Geth RPC to be available
run: |
for i in {1..10}; do
curl -s http://localhost:8545 && break
echo "Waiting for Geth RPC..." && sleep 3
done
- name: Install Hardhat dependencies
working-directory: hardhat
run: npm install
- name: Deploy contracts using Ignition
working-directory: hardhat
run: npx hardhat ignition deploy ./ignition/modules/Lock.js --network localhost
- name: Commit container as new image with contracts
run: |
docker commit geth-devnet ghcr.io/${{ github.repository_owner }}/go-ethereum:devnet-with-contracts
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push new image
run: docker push ghcr.io/${{ github.repository_owner }}/go-ethereum:devnet-with-contracts