Skip to content

update foundry example #8

update foundry example

update foundry example #8

name: Hardhat CI/CD Multichain
on: [push, pull_request]
env:
## Needed available as env variables for hardhat.config.js
TENDERLY_PROJECT_NAME: ${{ vars.TENDERLY_PROJECT_NAME }}
TENDERLY_ACCOUNT_NAME: ${{ vars.TENDERLY_ACCOUNT_NAME }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Virtual TestNet
uses: tenderly/[email protected]
with:
mode: CI # pauses testnet after deployment
access_key: ${{ secrets.TENDERLY_ACCESS_KEY }}
project_name: ${{ vars.TENDERLY_PROJECT_NAME }}
account_name: ${{ vars.TENDERLY_ACCOUNT_NAME }}
testnet_name: "Staging"
network_id: 1
chain_id_prefix: 7357
public_explorer: true
verification_visibility: 'src'
push_on_complete: true
- name: Install dependencies
run: npm install
working-directory: examples/hardhat-ignition
- name: Run Tests
run: npm run test:1
working-directory: examples/hardhat-ignition
deploy:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Virtual TestNet
uses: tenderly/[email protected]
with:
mode: CD
access_key: ${{ secrets.TENDERLY_ACCESS_KEY }}
project_name: ${{ vars.TENDERLY_PROJECT_NAME }}
account_name: ${{ vars.TENDERLY_ACCOUNT_NAME }}
testnet_name: "Staging"
network_id: |
1
137
chain_id_prefix: ""
public_explorer: true
verification_visibility: 'src'
push_on_complete: true
- name: Install dependencies
run: npm install
working-directory: examples/hardhat-ignition
- name: Deploy Contracts Mainnet
run: npm run deploy:1 -- --deployment-id deploy-1-${BUILD_SLUG}
working-directory: examples/hardhat-ignition
- name: Deploy Contracts Polygon
run: npm run deploy:137 -- --deployment-id deploy-137-${BUILD_SLUG}
working-directory: examples/hardhat-ignition