diff --git a/.github/workflows/deploy-subgraph-theGraph.yml b/.github/workflows/deploy-subgraph-theGraph.yml new file mode 100644 index 00000000..410e24da --- /dev/null +++ b/.github/workflows/deploy-subgraph-theGraph.yml @@ -0,0 +1,33 @@ +name: Prod Deploy theGraph Subgraph +on: + workflow_dispatch: +jobs: + deploy-subgraph: + name: Deploy subgraph workflow + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "16" + + - name: Install the graph cli + run: npm install @graphprotocol/graph-cli + + - name: Authenticate with prod subgraph + run: | + npx graph auth --product hosted-service ${{ secrets.PROD_SUBGRAPH_API_KEY }} + + - name: Install subgraph dependencies + working-directory: ./subgraph + run: npm install + + - name: Prepare for subgraph deployment + working-directory: ./subgraph + run: npm run prepare + + - name: Deploy subgraph + working-directory: ./subgraph + run: npm run deploy-theGraph diff --git a/subgraph/package.json b/subgraph/package.json index fc9c5412..8df9ea87 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -12,6 +12,7 @@ "prepare-dev": "yarn prepare-dev:schema && yarn prepare-dev:codegen && yarn prepare-dev:compile", "deploy-dev": "graph deploy --node https://api.graph-eu.p2pify.com/765768b776199f59bb7f1bf37253e73f/deploy --ipfs https://api.graph-eu.p2pify.com/765768b776199f59bb7f1bf37253e73f/ipfs forta-dev", "deploy": "graph deploy -l v0.0.1 --node https://api.graph-eu.p2pify.com/3e3485fa2703678549290ce52f45ef9c/deploy --ipfs https://api.graph-eu.p2pify.com/3e3485fa2703678549290ce52f45ef9c/ipfs forta-b", + "deploy-theGraph": "graph deploy --network matic --node https://api.thegraph.com/deploy/ forta-network/forta-network", "create-local": "graph create --node http://localhost:8020/ forta-network/forta-network", "remove-local": "graph remove --node http://localhost:8020/ forta-network/forta-network", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 forta-network/forta-network", @@ -25,4 +26,4 @@ "matchstick-as": "^0.5.0", "source-map-support": "^0.5.21" } -} +} \ No newline at end of file