Skip to content

Commit 9b88711

Browse files
committed
feat: subgraph build pinning
1 parent be9a317 commit 9b88711

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/solidity.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,19 @@ jobs:
265265
npx graph codegen subgraph.yaml
266266
npx graph build --ipfs=https://ipfs.network.thegraph.com subgraph.yaml | tee build_output.txt
267267
268+
cat build_output.txt
269+
268270
# Extract and process IPFS hashes from the file
269271
ipfs_hashes=$(grep -oP 'Qm[a-zA-Z0-9]{44}' build_output.txt)
272+
273+
echo "IPFS hashes: $ipfs_hashes"
274+
270275
for hash in $ipfs_hashes; do
271276
echo "Processing IPFS hash: $hash"
272-
curl -X POST -u "${{ secrets.INFURA_IPFS_API_KEY }}:${{ secrets.INFURA_IPFS_API_SECRET }}" "https://ipfs.infura.io:5001/api/v0/pin/add?arg=$hash"
273-
curl --request POST --url https://api.chainstack.com/v1/ipfs/pins/pinbycid \
274-
--header 'accept: application/json' \
275-
--header 'authorization: Bearer ${{ secrets.CHAINSTACK_API_KEY }}' \
276-
--header 'content-type: application/json' \
277-
--data "{\"cid\": \"$hash\"}"
277+
echo "Pinning $hash to Infura"
278+
curl -s -X POST -u "${{ secrets.INFURA_IPFS_API_KEY }}:${{ secrets.INFURA_IPFS_API_SECRET }}" "https://ipfs.infura.io:5001/api/v0/pin/add?arg=$hash" || true
279+
echo "Pinning $hash to Chainstack"
280+
curl -s --request POST --url https://api.chainstack.com/v1/ipfs/pins/pinbycid --header 'accept: application/json' --header 'authorization: Bearer ${{ secrets.CHAINSTACK_API_KEY }}' --header 'content-type: application/json' --data "{\"bucket_id\": \"BUCK-8412-8292-8457\", \"cid\": \"$hash\"}" || true
278281
done
279282
280283
# Write IPFS hashes to a file

0 commit comments

Comments
 (0)