Skip to content

Commit ffb82d4

Browse files
committed
Final improvements for subgraph CIs
1 parent b7d77c7 commit ffb82d4

2 files changed

Lines changed: 41 additions & 24 deletions

File tree

.github/workflows/thegraph_dev_deploy.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@ on:
44
workflow_dispatch:
55
inputs:
66
network:
7-
description: "Network for Subgraph deployment - Ethereum Mainnet (Mainnet) or Gnosis Chain (Gnosis)"
7+
description: "Network for Subgraph deployment - Ethereum or Gnosis Chain"
88
required: true
99
options:
10-
- mainnet
11-
- gnosis
10+
- Ethereum
11+
- Gnosis Chain
1212
type: choice
13-
type:
14-
description: "Brige type: Home or Foreign"
15-
required: true
16-
options:
17-
- home
18-
- foreign
19-
type: choice
2013

2114
concurrency:
2215
group: ${{ github.workflow }}-${{ github.ref }}
@@ -30,10 +23,7 @@ jobs:
3023
random_id: ${{ steps.random_id.outputs.random_id }}
3124
env:
3225
DEPLOY_API_KEY: ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
33-
TYPE: ${{ inputs.type }}
34-
NETWORK: ${{ inputs.network }}
3526
DEBUG: true
36-
SUBGRAPH_NAME: gbc-bridge-${{ inputs.network }}
3727
steps:
3828
- uses: actions/checkout@v4
3929

@@ -53,23 +43,38 @@ jobs:
5343
with:
5444
node-version-file: '.nvmrc'
5545

56-
- name: Install dependencies & build subgraphs
46+
- name: Install dependencies
5747
run: |
5848
cd subgraph
5949
yarn install
60-
yarn codegen
61-
yarn build
6250
6351
- name: Generate Random ID
6452
id: random_id
6553
run: |
6654
echo "random_id=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT
6755
68-
- name: Deploy Subgraphs
56+
- name: Build & Deploy Subgraph for ETH mainnet
57+
if: ${{ inputs.network == 'Ethereum' }}
6958
env:
7059
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
60+
TYPE: foreign
61+
DEBUG: true
62+
SUBGRAPH_NAME: gbc-bridge-mainnet
7163
run: |
7264
cd subgraph
65+
yarn build
66+
yarn deploy
67+
68+
- name: Build & Deploy Subgraph for Gnosis Chain
69+
if: ${{ inputs.network == 'Gnosis Chain' }}
70+
env:
71+
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
72+
TYPE: home
73+
DEBUG: true
74+
SUBGRAPH_NAME: gbc-bridge-gnosis
75+
run: |
76+
cd subgraph
77+
yarn build
7378
yarn deploy
7479
7580
notify:

.github/workflows/thegraph_prod_deploy.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
env:
2727
DEPLOY_API_KEY: ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
28-
TYPE: ${{ inputs.type }}
29-
NETWORK: ${{ inputs.network }}
3028
DEBUG: true
31-
SUBGRAPH_NAME: gbc-bridge-${{ inputs.network }}
3229
if: github.ref == 'refs/heads/main'
3330
steps:
3431
- uses: actions/checkout@v4
@@ -56,23 +53,38 @@ jobs:
5653
with:
5754
node-version-file: '.nvmrc'
5855

59-
- name: Install dependencies & build subgraphs
56+
- name: Install dependencies
6057
run: |
6158
cd subgraph
6259
yarn install
63-
yarn codegen
64-
yarn build
6560
6661
- name: Generate Random ID for buildcode
6762
id: random_id
6863
run: |
6964
echo "random_id=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT
7065
71-
- name: Deploy Subgraphs
66+
- name: Build & Deploy Subgraph for ETH mainnet
67+
if: ${{ inputs.network == 'Ethereum' }}
68+
env:
69+
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
70+
TYPE: foreign
71+
DEBUG: true
72+
SUBGRAPH_NAME: gbc-bridge-mainnet
73+
run: |
74+
cd subgraph
75+
yarn build
76+
yarn deploy
77+
78+
- name: Build & Deploy Subgraph for Gnosis Chain
79+
if: ${{ inputs.network == 'Gnosis Chain' }}
7280
env:
7381
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
82+
TYPE: home
83+
DEBUG: true
84+
SUBGRAPH_NAME: gbc-bridge-gnosis
7485
run: |
7586
cd subgraph
87+
yarn build
7688
yarn deploy
7789
7890
notify:

0 commit comments

Comments
 (0)