update example #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
8453 | |
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 Base | |
run: npm run deploy:8453 -- --deployment-id deploy-8453-${BUILD_SLUG} | |
working-directory: examples/hardhat-ignition |