44 workflow_dispatch :
55 inputs :
66 network :
7- description : " Network for Subgraph deployment - ( Gnosis Chain or Ethereum )"
7+ description : " Network for Subgraph deployment - Ethereum Mainnet (Mainnet) or Gnosis Chain (Gnosis )"
88 required : true
99 options :
10- - Ethereum
11- - Gnosis Chain
10+ - mainnet
11+ - gnosis
1212 type : choice
13-
14-
15- defaults :
16- run :
17- working-directory : subgraph/
13+ type :
14+ description : " Brige type: Home or Foreign"
15+ required : true
16+ options :
17+ - home
18+ - foreign
19+ type : choice
1820
1921concurrency :
2022 group : ${{ github.workflow }}-${{ github.ref }}
2123 cancel-in-progress : true
2224
23-
2425jobs :
2526 deploy :
2627 name : Deployment
2728 runs-on : ubuntu-latest
2829 outputs :
2930 random_id : ${{ steps.random_id.outputs.random_id }}
31+ env :
32+ ACCESS_TOKEN : ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
33+ TYPE : ${{ inputs.type }}
34+ NETWORK : ${{ inputs.network }}
35+ DEBUG : true
36+ SUBGRAPH_NAME : gbc-bridge-${{ inputs.type }}
3037 steps :
3138 - uses : actions/checkout@v4
3239
@@ -51,31 +58,18 @@ jobs:
5158 with :
5259 node-version-file : ' .nvmrc'
5360
54- - name : Install graph-cli & dependencies
61+ - name : Install dependencies & build subgraphs
5562 run : |
56- yarn global add @graphprotocol/graph-cli
63+ cd subgraph
5764 yarn install
58-
59- - name : Build Subgraph
60- run : yarn codegen && yarn build
61-
62- - name : Authenticate to Subgraph Studio
63- run : graph auth --studio ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
64-
65- - name : Deploy Subgraph for ETH Mainnet
66- if : ${{ inputs.network == 'Ethereum' }}
67- env :
68- SUBGRAPH_NAME : gbc-bridge-mainnet
69- ACCESS_TOKEN : ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
70- run : yarn deploy -l "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
71-
72- - name : Deploy Subgraph for Gnosis Chain
73- if : ${{ inputs.network == 'Gnosis Chain' }}
74- env :
75- SUBGRAPH_NAME : gbc-bridge-gnosis
76- ACCESS_TOKEN : ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
77- run : yarn deploy -l "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
65+ yarn codegen
66+ yarn build
7867
68+ - name : Deploy Subgraphs
69+ env :
70+ SUBGRAPH_LABELS : " ${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
71+ run : |
72+ yarn deploy
7973
8074 notify :
8175 uses : ./.github/workflows/slack_release_notification.yml
0 commit comments