diff --git a/.github/workflows/deploy-subgraph.yml b/.github/workflows/deploy-subgraph.yml index b31ab20c1..63ef28cf6 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(env.network, 'arbitrum')}} + run: 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 }}:${{ env.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 }}:${{ env.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