Skip to content

Commit

Permalink
add deploy mumbai gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
mihanix committed Nov 15, 2023
1 parent dd47d18 commit 33c63fc
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy_mumbai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build & test & deploy contracts on mumbai network
on:
push:
branches:
- master

jobs:
deploy-mumbai:
name: Add node_modules with some contract dependencies
runs-on: node:16.14
env:
PVK_A1: ${{ secrets.mumbai_deployer_pk }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: hit yarn cache
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: cache yarn
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: build node modules
uses: yarn install --non-interactive

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

- name: build contracts
run: forge build

- name: test contracts
run: forge test

- name: deploy contracts to mumbai
uses: foundry-rs-foundry-toolchain@v1
run: |
forge build
forge test
forge script ./script/DeployAll.s.sol \
--rpc-url ${{ secrets.mumbai_rpc_url }} \
--etherscan-api-key ${{ secrets.polygonscan_api_key }} \
--private-key $PVK_A1 \
--broadcast \
--verify

0 comments on commit 33c63fc

Please sign in to comment.