Deploy subgraph to production env #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy subgraph to production env | |
on: | |
workflow_dispatch: | |
branches: [main] | |
inputs: | |
subgraphVersion: | |
description: "Subgraph version" | |
required: true | |
default: "0.0.1" | |
type: string | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy subgraph | |
env: | |
SUBGRAPH_VERSION: ${{ github.event.inputs.subgraphVersion }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
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: Authenticate The Graph CLI | |
run: npx graph auth --product hosted-service ${{ secrets.THE_GRAPH_ACCESS_TOKEN_PRODUCTION }} | |
- name: Deploy subgraph to Polygon | |
run: cd ./packages/subgraph && npm run deploy:production | |
- name: Deploy subgraph to Ethereum | |
run: cd ./packages/subgraph && npm run deploy:production:ethereum |