Skip to content

Commit

Permalink
Only deploy on release
Browse files Browse the repository at this point in the history
This changes the Rinkeby deploy behavior to only ocurr on release
creation. To reduce excess deployments.
  • Loading branch information
gitblamecarrot committed Jun 5, 2021
1 parent 8bb23a5 commit 4c78e07
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 46 deletions.
14 changes: 0 additions & 14 deletions .github/pull_request_template.md

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/contract-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: yarn
- run: yarn build
- name: Run contract tests
run: |
cd packages/nouns-contracts
yarn test
build_and_deploy:
name: Build and Deploy
needs: build_and_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- 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 run --network rinkeby scripts/deploy-ci.ts
- 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'`"
32 changes: 0 additions & 32 deletions .github/workflows/contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,3 @@ jobs:
run: |
cd packages/nouns-contracts
yarn test
build_and_deploy:
name: Build and Deploy
needs: build_and_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- 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 run --network rinkeby scripts/deploy-ci.ts
- 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'`"

0 comments on commit 4c78e07

Please sign in to comment.