You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求适用于eth-brownie==1.19.3的Github Actions部署Workflow.yaml文件

Github Actions Workflow for eth-brownie Sepolia Deployment

Here's a complete workflow.yaml configuration file tailored for your eth-brownie 1.19.3 setup:

name: Deploy to Sepolia Testnet

on:
  push:
    branches: [ main ]  # Trigger deployment on push to main branch (adjust to your target branch)

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: "3.10"  # Verified compatible with eth-brownie 1.19.3

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install eth-brownie==1.19.3
          npm install -g ganache-cli  # Optional, only needed if your deployment relies on local testing

      - name: Configure Sepolia network (if not pre-configured in brownie)
        run: |
          brownie networks add Ethereum sepolia host=https://sepolia.infura.io/v3/${{ secrets.INFURA_PROJECT_ID }} chainid=11155111 explorer=https://api-sepolia.etherscan.io/api

      - name: Deploy contract to Sepolia
        env:
          PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
          INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
        run: |
          brownie run scripts/deploy.py --network sepolia

Critical Pre-Workflow Setup

  • Add Repository Secrets:

    • Go to your repo → Settings → Secrets and variables → Actions → New repository secret
    • Create PRIVATE_KEY: Private key of your Sepolia-funded Ethereum account (never commit this to code)
    • Create INFURA_PROJECT_ID: Your Infura project ID (sign up for free if you don't have one)
  • Adjust Deployment Script Path:

    • Update scripts/deploy.py in the brownie run command to match your actual deployment script's location/name
  • Security Best Practices:

    • Restrict push permissions to your target branch to prevent unauthorized deployments
    • For production-like setups, add a manual approval step by adding environment: production to the job and configuring environment protection rules in Github settings

内容的提问来源于stack exchange,提问作者Matt - Block-Farms.io

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 08:17:13