-
Notifications
You must be signed in to change notification settings - Fork 7
/
action.yml
48 lines (48 loc) · 1.7 KB
/
action.yml
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
name: 'Graph Deploy'
description: 'Deploy a subgraph to thegraph.com to index Ethereum and IPFS'
branding:
icon: 'upload-cloud'
color: 'blue'
inputs:
graph_access_token:
description: 'Your access token to deploy to the hosted graph'
required: false
graph_deploy_key:
description: 'Your deploy key for the subgraph studio'
required: false
graph_version_label:
description: 'Your version label for subgraph studio'
required: false
graph_subgraph_name:
description: 'The name of the subgraph'
required: true
graph_account:
description: 'The account or organization that the subgraph is owned by'
required: true
graph_config_file:
description: 'The config file you will use to deploy'
required: false
default: subgraph.yml
graph_deploy_studio:
description: 'Deploy the subgraph to studio? (true/false)'
required: false
default: false
outputs:
success:
description: 'The Success/Failure of the action'
runs:
using: 'composite'
steps:
- id: install-graph-cli
run: |
yarn global add @graphprotocol/graph-cli@0.28.0
echo "$(yarn global bin)" >> $GITHUB_PATH
shell: bash
- id: deploy
run: |
if [ "${{inputs.graph_deploy_studio}}" = "true" ]; then
graph deploy --studio --deploy-key ${{inputs.graph_deploy_key}} ${{inputs.graph_subgraph_name}} ${{inputs.graph_config_file}} --version-label ${{inputs.graph_version_label}}
else
graph deploy --access-token ${{inputs.graph_access_token}} ${{inputs.graph_account}}/${{inputs.graph_subgraph_name}} ${{inputs.graph_config_file}} --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/
fi
shell: bash