Skip to content

deploy

deploy #8

Workflow file for this run

name: deploy
on:
workflow_dispatch:
inputs:
network:
description: 'Network name for deployment'
required: true
block_explorer_api_key:
description: 'Block explorer API key (use default value for Blockscout)'
required: true
default: 'no'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Compile contracts
run: npm run compile
- name: Deploy Router
run: npm run deploy:router -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
- name: Deploy SimpleCaller
run: npm run deploy:sc -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
- name: Deploy UniswapV2Caller
run: npm run deploy:univ2caller -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
- name: Deploy Safe Proxy
run: npm run deploy:safe -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
- name: Deploy SimpleCallerWithPermit2
run: npm run deploy:scwp2 -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
- name: Initialize Router
run: npm run initialize:router -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }}
- name: Set up Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Fetch all branches
run: git fetch --all
- name: Checkout current branch
run: git checkout ${{ github.ref_name }}
- name: Add and commit deployment.json
run: |
git add scripts/deployment.json
git commit -m "Update deployment.json [skip ci]" || echo "No changes to commit"
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin ${{ github.ref_name }}
- name: Verify Contracts
run: npm run verify -- --network ${{ github.event.inputs.network || 'truffle-dashboard' }}
env:
BLOCK_EXPLORER_API_KEY: ${{ github.event.inputs.block_explorer_api_key }}