Skip to content

Instantly share code, notes, and snippets.

@Breta01
Created April 23, 2022 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Breta01/80fc8a9eec782886e59a4f68a2d8f65a to your computer and use it in GitHub Desktop.
Save Breta01/80fc8a9eec782886e59a4f68a2d8f65a to your computer and use it in GitHub Desktop.
Example of action for deploying smart contracts.
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "**.sol"
name: Deploy to testnet
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
WEB3_INFURA_PROJECT_ID: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
POLYGONSCAN_TOKEN: ${{ secrets.POLYGONSCAN_TOKEN }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install python dependencies
run: pip install -r requirements.txt
- name: Create mock .env file
run: touch .env
- name: Deploy to testnet
run: brownie run deploy_live --network polygon-test
- name: Commit deployment
uses: EndBug/add-and-commit@v9
with:
message: Deploy to testnet
default_author: github_actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment