Deploy subgraph #26
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
subgraph-name: | |
description: 'Subgraph to deploy (e.g. ob4-mainnet/0.1)' | |
required: true | |
type: string | |
network: | |
description: 'Network to deploy to' | |
required: true | |
type: choice | |
options: | |
- arbitrum-one | |
- arbitrum_sepolia | |
- avalanche | |
- base | |
- bsc | |
- ethereum | |
- flare | |
- mumbai | |
- oasis_sapphire | |
- matic | |
- sepolia | |
- songbird | |
- linea | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- run: nix develop -c rainix-sol-prelude | |
- run: nix develop -c graph codegen | |
working-directory: subgraph | |
- run: nix develop -c graph build --network ${{ inputs.network }} | |
working-directory: subgraph | |
- run: nix develop -c goldsky login --token ${{ secrets.CI_GOLDSKY_TOKEN }} | |
# Check if the repo is clean before deploying. | |
- run: git diff --exit-code -- . ':(exclude)subgraph/subgraph.yaml' | |
- run: nix develop -c goldsky subgraph deploy ${{ inputs.subgraph-name }} | |
working-directory: subgraph |