This project follows the DEV.to #ActionsHackathon21 hackathon.
Use GitHub Actions and Workflows to build and deploy upgradable smartcontracts into the ethereum blockchains. After its deployment, the contract's ABI will be released, and the artifacts will be saved into a deployed branch.
Check the complete workflow here:
- Deploy contracts to testnet on each push on development branches (migrate-to-testnet.yml)
- Deploy contracts to mainnet on each push on tag (migrate-to-mainnet.yml)
- actions/checkout@v2 To checkout the source code from the repository
- actions/cache@v2 To cache the dependencies, allow us to re use them for future builds
- marvinpinto/action-automatic-releases@latest To release your build to Github Release page
- You can config the branch postfix which holds the development's artifacts with the
DEPLOY_BRANCH_POSTFIX
variable. - You can also configure the development branches which you want to deploy to testnet, with
branches
key. - To config the blockchain you want to deploy to, use the
WALLET_SECRET
,RPC
,NETWORK_ID
andCONFIRMATIONS
variables Important! You should store the wallet secret in GitHub's secret (Settings > Secrets). On this project, I stored asDEV_WALLET_SECRET
andPROD_WALLET_SECRET
secrets
- Use actions/checkout@v2 to checkout source code from the repository
- Use actions/setup-node@v2 to setup nodejs
- Use actions/cache@v2 to cache dependencies
- Install build dependencies (
yarn
,node-gyp
,node-gyp-build
) - Install dependencies from
yarn.lock
- Synchronize previous built artifacts from the deployment branch
- Build and Migrate smartcontracts
- Push new built artifacts into the deployment branch
- Release smartcontracts' JSON (including ABI)