Skip to content

Commit

Permalink
chore: update deployment script to use studio only
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed May 13, 2024
1 parent b9312f2 commit f3771cc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Arbitrum
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:arbitrum

deploy-aurora:
Expand All @@ -29,7 +30,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Aurora
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:aurora

deploy-avalanche:
Expand All @@ -42,7 +44,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Avalanche
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:avalanche

deploy-base:
Expand All @@ -69,7 +72,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy BSC
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:bsc

deploy-fantom:
Expand All @@ -82,7 +86,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Fantom
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:fantom

deploy-gnosis:
Expand All @@ -95,7 +100,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Gnosis
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:gnosis

deploy-mainnet:
Expand All @@ -108,7 +114,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Mainnet
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:mainnet

deploy-optimism:
Expand All @@ -121,7 +128,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Optimism
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:optimism

deploy-polygon:
Expand All @@ -134,7 +142,8 @@ jobs:
uses: ./.github/actions/setup
- name: Deploy Polygon
env:
GRAPH_KEY: ${{ secrets.GRAPH_HOSTED_KEY }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:polygon

deploy-zkevm:
Expand Down
36 changes: 15 additions & 21 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,26 @@ set -o errexit
# Run graph build
yarn build:$NETWORK

# Studio deployments
platform_base=studio
platform_zkevm=studio

# Load platform
if [[ -z $PLATFORM ]]; then
PLATFORM_VAR=platform_$NETWORK
PLATFORM=${!PLATFORM_VAR}
# Check deployment version
if [[ -z $VERSION_LABEL ]]; then
echo 'Please make sure a version label is provided'
exit 1
fi

# Deploy subgraph
if [ "$PLATFORM" == "studio" ]; then
echo "Deploying $NETWORK to subgraph studio"
if [[ -z $VERSION_LABEL ]]; then
echo 'Please make sure a version label is provided'
exit 1
fi
yarn graph deploy mimic-v3-$NETWORK --studio --deploy-key $GRAPH_KEY -l $VERSION_LABEL
# Define subgraph name
if [[ "$NETWORK" = "base" || "$NETWORK" = "zkevm" ]]; then
NAME=mimic-v3-$NETWORK
else
echo "Deploying $NETWORK to hosted service"
yarn graph deploy mimic-fi/v3-$NETWORK --product hosted-service --deploy-key $GRAPH_KEY
NAME=v3-$NETWORK
fi

# Deploy subgraph
echo "Deploying $NAME to subgraph studio"
yarn graph deploy mimic-v3-$NETWORK --studio --deploy-key $GRAPH_KEY -l $VERSION_LABEL

# Check deployer status
if [ $? -ne 0 ]; then
echo "Error trying to deploy subgraph with exit status $?"
echo "$output"
exit $?
echo "Error trying to deploy subgraph with exit status $?"
echo "$output"
exit $?
fi

0 comments on commit f3771cc

Please sign in to comment.