diff --git a/.github/workflows/deploy-subgraph.yml b/.github/workflows/deploy-subgraph.yml index b31ab20c1..4b32f972b 100644 --- a/.github/workflows/deploy-subgraph.yml +++ b/.github/workflows/deploy-subgraph.yml @@ -3,15 +3,15 @@ name: Deploy the Subgraph on: workflow_dispatch: inputs: - network: - description: The network to deploy the subgraph to + graph_environment: + description: The Graph environment to deploy to required: true - default: 'arbitrum-sepolia' + default: 'graph-studio-devnet' type: choice options: - - arbitrum-sepolia-devnet - - arbitrum-sepolia - - arbitrum + - graph-studio-devnet + - graph-studio-testnet + - graph-studio-mainnet subgraph: description: The name of the subgraph to deploy required: true @@ -32,13 +32,17 @@ permissions: jobs: buildAndDeploy: runs-on: ubuntu-latest - environment: kleros-org-subgraph + environment: ${{ inputs.graph_environment }} steps: - name: Harden Runner uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.5.0 with: egress-policy: audit + - name: Validate Network environment variable + if: ${{!startsWith(vars.NETWORK, 'arbitrum')}} + run: echo ${{vars.NETWORK}} && exit 1 + - name: Checkout code uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 @@ -66,7 +70,7 @@ jobs: if: ${{ inputs.update }} run: | export PATH=$PWD/../bin:$PATH - yarn update:${{ inputs.subgraph }}:${{ inputs.network }} + yarn update:${{ inputs.subgraph }}:${{ vars.NETWORK }} working-directory: subgraph - name: Build the subgraph @@ -75,10 +79,10 @@ jobs: yarn build:${{ inputs.subgraph }} working-directory: subgraph - - name: Authenticate with TheGraph - run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --product hosted-service + - name: Authenticate with TheGraph Studio + run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --studio working-directory: subgraph - name: Deploy the subgraph - run: yarn deploy:${{ inputs.subgraph }}:${{ inputs.network }} + run: yarn deploy:${{ inputs.subgraph }}:${{ vars.NETWORK }} working-directory: subgraph diff --git a/scripts/act-subgraph.yml b/scripts/act-subgraph.yml index 08b4c4d6d..392575317 100755 --- a/scripts/act-subgraph.yml +++ b/scripts/act-subgraph.yml @@ -1,3 +1,3 @@ #!/usr/bin/env bash -act workflow_dispatch -j buildAndDeploy --input network=arbitrum-sepolia,update=true +act workflow_dispatch -j buildAndDeploy --input graph_environment=graph-studio-devnet,update=true --env network=arbitrum-sepolia-devnet diff --git a/subgraph/package.json b/subgraph/package.json index c8cb22540..fcb16ceed 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -10,9 +10,9 @@ "build:core": "graph build --output-dir core/build/ core/subgraph.yaml", "test:core": "cd core && graph test", "clean:core": "graph clean --codegen-dir core/generated/ --build-dir core/build/ && rm core/subgraph.yaml.bak.*", - "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.2 core/subgraph.yaml", - "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet -l v0.0.2 core/subgraph.yaml", - "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.2 core/subgraph.yaml", + "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.3 core/subgraph.yaml", + "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet -l v0.0.3 core/subgraph.yaml", + "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.3 core/subgraph.yaml", "": "------------------------------------------------------------------------------------------", "update:drt:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia dispute-template-registry/subgraph.yaml", "update:drt:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia dispute-template-registry/subgraph.yaml", @@ -22,8 +22,8 @@ "build:drt": "graph build --output-dir dispute-template-registry/generated/ dispute-template-registry/subgraph.yaml", "test:drt": "cd dispute-template-registry && graph test ", "clean:drt": "graph clean --codegen-dir dispute-template-registry/generated/ --build-dir dispute-template-registry/build/ && rm dispute-template-registry/subgraph.yaml.bak.*", - "deploy:drt:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-devnet -l v0.0.2 dispute-template-registry/subgraph.yaml", - "deploy:drt:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-testnet -l v0.0.2 dispute-template-registry/subgraph.yaml", + "deploy:drt:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-devnet -l v0.0.3 dispute-template-registry/subgraph.yaml", + "deploy:drt:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-testnet -l v0.0.3 dispute-template-registry/subgraph.yaml", " ": "-----------------------------------------------------------------------------------------", "update:arbitrum-sepolia-devnet": "./scripts/all.sh update arbitrum-sepolia-devnet", "update:arbitrum-sepolia": "./scripts/all.sh update arbitrum-sepolia",