Skip to content

Commit

Permalink
chore: setup github deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Aug 15, 2023
1 parent d00c155 commit a7925cc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy

on:
push:
branches:
- master

jobs:
deploy-arbitrum:
name: Deploy Arbitrum
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Deploy Arbitrum
env:
GRAPH_KEY: ${{ secrets.GRAPH_KEY }}
run: yarn deploy:arbitrum
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
"build:gnosis": "NETWORK=gnosis ./scripts/build.sh",
"build:mainnet": "NETWORK=mainnet ./scripts/build.sh",
"build:polygon": "NETWORK=polygon ./scripts/build.sh",
"build:optimism": "NETWORK=optimism ./scripts/build.sh"
"build:optimism": "NETWORK=optimism ./scripts/build.sh",
"deploy:arbitrum": "NETWORK=arbitrum ./scripts/deploy.sh",
"deploy:avalanche": "NETWORK=avalanche ./scripts/deploy.sh",
"deploy:bsc": "NETWORK=bsc ./scripts/deploy.sh",
"deploy:fantom": "NETWORK=fantom ./scripts/deploy.sh",
"deploy:gnosis": "NETWORK=gnosis ./scripts/deploy.sh",
"deploy:mainnet": "NETWORK=mainnet ./scripts/deploy.sh",
"deploy:polygon": "NETWORK=polygon ./scripts/deploy.sh",
"deploy:optimism": "NETWORK=optimism ./scripts/deploy.sh"
},
"dependencies": {
"@mimic-fi/v3-authorizer": "0.1.0",
Expand Down
16 changes: 16 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Exit script as soon as a command fails.
set -o errexit

# Run graph build
yarn build:$NETWORK

# Require $GRAPH_KEY to be set
if [[ -z "${GRAPH_KEY}" ]]; then
echo "Please set \$GRAPH_KEY to your The Graph deploy key to run this command."
exit 1
fi

# Deploy subgraph
graph deploy mimic-fi/v3-$NETWORK --product hosted-service --access-token "$GRAPH_KEY"

0 comments on commit a7925cc

Please sign in to comment.