-
Notifications
You must be signed in to change notification settings - Fork 434
65 lines (63 loc) · 1.92 KB
/
contract-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Contracts CD
on:
release:
types:
- created
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install Yarn
run: npm install -g yarn
- run: yarn
- run: yarn build
- name: Run contract tests
run: |
cd packages/nouns-contracts
yarn test
- name: Uninstall Yarn
if: always()
run: npm uninstall -g yarn
build_and_deploy:
name: Build and Deploy
needs: build_and_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install Yarn
run: npm install -g yarn
- run: yarn
- run: yarn build
- name: Deploy contract to Rinkeby
env:
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
MNEMONIC: ${{ secrets.MNEMONIC }}
run: |
cd packages/nouns-contracts
npx hardhat deploy-ci --network rinkeby
- name: Verify contract on Etherscan
env:
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: |
cd packages/nouns-contracts
echo "Giving Etherscan time to index"
sleep 60 # This could be replaced by polling etherscan on that address, wait for non-404
npx hardhat verify --network rinkeby `cat logs/deploy.json| jq -r '.contractAddress'`
- name: Look here for contract info
run: |
cd packages/nouns-contracts
echo "Contract deployed on Rinkeby to `cat logs/deploy.json| jq -r '.contractAddress'`"
- name: Uninstall Yarn
if: always()
run: npm uninstall -g yarn