Deploy Graph #782
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 Graph | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
type: environment | |
description: Select environment | |
subgraph: | |
type: choice | |
description: Select subgraph | |
options: | |
- bridgeworld | |
- bridgeworld-approvals | |
- bridgeworld-corruption | |
- bridgeworld-kote | |
- bridgeworld-recruits | |
- governance-staking | |
- magicswap | |
- smol | |
- memecoins | |
version: | |
description: Subgraph version | |
required: true | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./subgraphs/${{ inputs.subgraph }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci --prefix ../.. | |
- name: Generate code for DEV | |
if: inputs.environment == 'Development' | |
run: npm run generate:dev --if-present | |
- name: Generate code for PROD | |
if: inputs.environment == 'Production' | |
run: npm run generate:prod --if-present | |
- name: Test | |
run: npm test --if-present | |
- name: Build subgraph | |
run: npx graph build | |
- name: Deploy to DEV | |
if: inputs.environment == 'Development' | |
run: npx goldsky subgraph deploy ${{ inputs.subgraph }}-dev/${{ inputs.version }} --token ${{ secrets.GOLDSKY_DEPLOY_KEY }} | |
- name: Deploy to PROD | |
if: inputs.environment == 'Production' | |
run: npx goldsky subgraph deploy ${{ inputs.subgraph }}/${{ inputs.version }} --token ${{ secrets.GOLDSKY_DEPLOY_KEY }} |