-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 2.01 KB
/
deploy-prod-subgraph.yaml
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
49
50
51
52
53
54
55
56
57
name: Deploy subgraph to production env
on:
workflow_dispatch:
inputs:
version:
description: "The subgraph version to deploy. For example, 1.34.0. The given number should correspond to an existing tag @bosonprotocol/subgraph@<VERSION>"
required: true
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy subgraph
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BSNORG_ACTIONS_SECRET }}
ref: "@bosonprotocol/subgraph@${{ inputs.version }}"
fetch-depth: "0"
- uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}
- run: npm ci
- id: build
run: npm run build -- --cache-dir=".turbo"
- name: Set github bot
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Authenticate The Graph CLI
run: npx graph auth https://api.0xgraph.xyz/deploy/ ${{ secrets.ORMI_0x_GRAPH_API_KEY_PRODUCTION }}
- name: Deploy subgraph to Polygon
run: cd ./packages/subgraph && npm run deploy:production:polygon
env:
ORMI_0x_GRAPH_API_KEY: ${{ secrets.ORMI_0x_GRAPH_API_KEY_PRODUCTION }}
- name: Deploy subgraph to Ethereum
run: cd ./packages/subgraph && npm run deploy:production:ethereum
env:
ORMI_0x_GRAPH_API_KEY: ${{ secrets.ORMI_0x_GRAPH_API_KEY_PRODUCTION }}
- name: Commit & Push
env:
GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }}
GITHUB_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }}
run: |
git pull origin main
git add .
git commit -m "chore: deploy production subgraphs [skip ci]"
git push origin HEAD:main