Skip to content

Workflow to auto deploy contracts when changed #3

Workflow to auto deploy contracts when changed

Workflow to auto deploy contracts when changed #3

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 }}
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: contracts/package-lock.json
- name: Deploy IPC contracts to calibration net
run: |
cd contracts
make deploy-ipc NETWORK=calibrationnet
# - name: Copy deployment script files to the host
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
# username: ubuntu
# key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
# source: "scripts/deploy_subnet_under_calibration_net/deploy.sh"
# target: "/home/ubuntu"
# - name: Copy config files to the host
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
# username: ubuntu
# key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
# source: "scripts/deploy_subnet_under_calibration_net/.ipc"
# target: "/home/ubuntu"
# - name: Set up ipc config folder on the host
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
# username: ubuntu
# key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
# script: rm -rf /home/ubuntu/.ipc && cp -r /home/ubuntu/scripts/deploy_subnet_under_calibration_net/.ipc /home/ubuntu/
# - name: Create wallet file locally
# run: |
# echo '${{ secrets.CI_TEST_WALLET_JSON }}' > evm_keystore.json
# - name: Copy wallet file to the host
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
# username: ubuntu
# key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
# source: "evm_keystore.json"
# target: "/home/ubuntu/.ipc"
# - name: Run deploy scripts on the host
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
# username: ubuntu
# key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
# script: bash -il /home/ubuntu/scripts/deploy_subnet_under_calibration_net/deploy.sh ${{ github.head_ref }}
# command_timeout: 50m