Skip to content

Deploy VestingScheduler Subgraphs (Goldsky) #4

Deploy VestingScheduler Subgraphs (Goldsky)

Deploy VestingScheduler Subgraphs (Goldsky) #4

name: Deploy VestingScheduler Subgraphs (Goldsky)
on:
workflow_dispatch:
push:
branches:
- "release-v1/*"
paths:
- "subgraphs/vesting-scheduler/**"
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: subgraphs/vesting-scheduler
strategy:
matrix:
networks:
[
"avalanche-c",
"arbitrum-one",
"bsc-mainnet",
"eth-mainnet",
"xdai-mainnet",
"optimism-mainnet",
"polygon-mainnet",
]
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 18
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install
run: pnpm install
- name: Generate YAML & Types
run: pnpm gen
- name: Build
run: pnpm exec graph build ${{format('./{0}.subgraph.yaml', matrix.networks)}}
- name: Test
run: pnpm test
- name: Get Version
id: get-version
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('package.json'));
return packageJson.version;
- name: Goldsky Deploy
run: pnpm exec goldsky subgraph deploy ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build --token ${{secrets.GOLDSKY_API_KEY}}
- name: Goldsky Tag
run: pnpm exec goldsky subgraph tag ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag latest --token ${{secrets.GOLDSKY_API_KEY}}