Skip to content

Workflow to auto deploy contracts when changed #7

Workflow to auto deploy contracts when changed

Workflow to auto deploy contracts when changed #7

name: Auto deploy IPC contracts when changed
on:
workflow_dispatch:
# TODO: Test only. Remove before PR merge
pull_request:
push:
branches:
- main
paths:
- contracts/**
concurrency:
# Only allow one run at a time for this workflow
group: auto-deploy-contracts
cancel-in-progress: true
jobs:
deploy-contracts:
runs-on: ubuntu-latest
env:
RPC_URL: https://calibration.filfox.info/rpc/v1
PRIVATE_KEY: ${{ secrets.CONTRACTS_DEPLOYER_PRIVATE_KEY }}
steps:
- name: Checkout code repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
submodules: recursive
- name: Setup node and npm
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: contracts/package-lock.json
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Deploy IPC contracts to calibration net
run: |
cd contracts
npm install --save hardhat
make deploy-ipc NETWORK=calibrationnet