Skip to content

Commit

Permalink
Add evmsheet deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Jul 26, 2023
1 parent 7b3825e commit 540c840
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 14 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "staging"

jobs:
build_contracts:
starksheet-deployer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -28,7 +28,29 @@ jobs:
context: ./packages/starksheet-cairo
platforms: linux/amd64,linux/arm64

build_webapp:
evmsheet-deployer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/the-candy-shop/starksheet-monorepo/starksheet-solidity:latest
context: ./packages/starksheet-solidity
platforms: linux/amd64,linux/arm64

webapp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
20 changes: 8 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,17 @@ services:
- ethereum

ethereum-deployer:
image: ghcr.io/foundry-rs/foundry
build: ./packages/starksheet-solidity
platform: linux/x86_64
entrypoint: forge
depends_on:
ethereum:
condition: service_healthy
environment:
RPC_URL: http://ethereum:8545
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ETHERSCAN_API_KEY: "foobar"
volumes:
- ./packages/starksheet-solidity:/app/starksheet/packages/starksheet-solidity
working_dir: /app/starksheet/packages/starksheet-solidity
command:
- "script"
- "script/Evmsheet.s.sol"
- "--broadcast"
- "--rpc-url"
- "http://ethereum:8545"
- ethereum-broadcast:/app/starksheet/packages/starksheet-solidity/broadcast
- ethereum-out:/app/starksheet/packages/starksheet-solidity/out
networks:
- ethereum

Expand All @@ -42,7 +35,8 @@ services:
condition: service_completed_successfully
working_dir: /app/starksheet/packages/starksheet-webapp
volumes:
- ./packages/starksheet-solidity:/app/starksheet/packages/starksheet-solidity
- ethereum-broadcast:/app/starksheet/packages/starksheet-solidity/broadcast
- ethereum-out:/app/starksheet/packages/starksheet-solidity/out
environment:
- REACT_APP_NETWORK=anvil
- REACT_APP_RPC_URL=http://0.0.0.0:8545
Expand Down Expand Up @@ -110,6 +104,8 @@ services:
volumes:
starknet-deployments:
starknet-build:
ethereum-broadcast:
ethereum-out:

networks:
starknet:
Expand Down
9 changes: 9 additions & 0 deletions packages/starksheet-solidity/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ghcr.io/foundry-rs/foundry

WORKDIR /app/starksheet/packages/starksheet-solidity
COPY . .
ENV ETHERSCAN_API_KEY=
ENV FOUNDRY_PROFILE=docker

ENTRYPOINT [ "forge" ]
CMD ["script", "script/Evmsheet.s.sol", "--broadcast"]
4 changes: 4 additions & 0 deletions packages/starksheet-solidity/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ out = 'out'
libs = ['lib']
eth_rpc_url = "anvil"

[profile.docker]
eth_rpc_url = "docker"

[rpc_endpoints]
goerli = "${GOERLI_RPC_URL}"
anvil = "http://127.0.0.1:8545"
kakarot = "http://127.0.0.1:3030"
docker = "${RPC_URL}"

[etherscan]
goerli = { key = "${ETHERSCAN_API_KEY}" }

0 comments on commit 540c840

Please sign in to comment.