Skip to content

Commit 5607e7c

Browse files
authored
Add goerli to deploy (#38)
* Add goerli to deploy * Update CI * Fix * Update node * Fix * Fix
1 parent e71a417 commit 5607e7c

File tree

2 files changed

+48
-12
lines changed

2 files changed

+48
-12
lines changed

.github/workflows/CI.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
node: ['14.x']
1414
os: [ubuntu-latest]
15-
network: ['mainnet', 'goerli']
15+
network: ['goerli', 'mainnet']
1616

1717
runs-on: ${{ matrix.os }}
1818

.github/workflows/deploy.yaml

+47-11
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,55 @@ on:
88
- "v*"
99

1010
jobs:
11-
docker:
12-
name: Deploy Subgraphs
13-
runs-on: ubuntu-latest
14-
container: node:16-alpine
11+
deploy:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
network: ['goerli', 'mainnet']
16+
17+
runs-on: ${{ matrix.os }}
18+
1519
steps:
1620
- name: Checkout code
1721
uses: actions/checkout@v2
18-
- run: |
19-
yarn install
20-
yarn prepare:mainnet
21-
yarn run codegen
22-
yarn run build
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: 14.x
27+
28+
- name: Get yarn cache directory path
29+
id: yarn-cache-dir-path
30+
run: echo "::set-output name=dir::$(yarn cache dir)"
31+
32+
- uses: actions/cache@v2
33+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
34+
with:
35+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
36+
key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37+
restore-keys: |
38+
${{ matrix.os }}-yarn-
39+
40+
- name: Install dependencies
41+
run: yarn install
42+
43+
- name: Run network prepare
44+
env:
45+
NETWORK: ${{ matrix.network }}
46+
run: yarn prepare:$NETWORK
47+
48+
- name: Run codegen
49+
run: yarn run codegen
50+
51+
- name: Build project
52+
run: yarn run build
53+
54+
- name: Install Graph CLI
55+
run: |
2356
yarn global add @graphprotocol/graph-cli
2457
graph auth https://api.thegraph.com/deploy/ ${{ secrets.THEGRAPH_TOKEN }}
25-
yarn deploy:mainnet
26-
name: Deploy
58+
59+
- name: Deploy Subgraphs
60+
env:
61+
NETWORK: ${{ matrix.network }}
62+
run: yarn deploy:$NETWORK

0 commit comments

Comments
 (0)