Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
45 changes: 45 additions & 0 deletions .github/workflows/deploy-polygon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Sleuth [Polygon]

on:
workflow_dispatch:
inputs:
deployer_address:
description: WalletConnect address to deploy from
required: true

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Deploy Sleuth [Polygon]
runs-on: ubuntu-latest
steps:
- name: Start Seacrest
uses: hayesgm/seacrest@v1
with:
ethereum_url: "${{ secrets.ETH_POLYGON_URL }}"

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes

- name: Forge Deploy Sleuth [Polygon]
run: script/polygon/deploy.sh
env:
POLYGON_API_KEY: "${{ secrets.POLYGON_API_KEY }}"
ETH_FROM: "${{ inputs.deployer_address }}"
RPC_URL: "http://localhost:8585"
28 changes: 28 additions & 0 deletions script/polygon/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -exo pipefail

if [ -n "$ETHEREUM_PK" ]; then
wallet_args="--private-key $ETHEREUM_PK"
else
wallet_args="--unlocked"
fi

if [ -n "$RPC_URL" ]; then
rpc_args="--rpc-url $RPC_URL"
else
rpc_args=""
fi

if [ -n "$POLYGON_API_KEY" ]; then
etherscan_args="--verify --etherscan-api-key $POLYGON_API_KEY"
else
etherscan_args=""
fi

forge create \
$rpc_args \
$etherscan_args \
$wallet_args \
$@ \
src/Sleuth.sol:Sleuth