Skip to content

Commit

Permalink
Use goldsky as prod
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed May 30, 2024
1 parent e26df10 commit f91a9d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release PROD

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
- "*.*.*" # Push events to matching x.x.x tags, e.g. 1.0.0, 1.4.5, etc

jobs:
deploy_to_0xgraph:
Release_PROD:
strategy:
matrix:
node: ["21.x"]
Expand All @@ -17,6 +17,9 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Install Goldsky CLI
run: curl -fsSL https://cli.goldsky.com/install | FORCE=1 bash

- name: Checkout code
uses: actions/checkout@v2

Expand All @@ -40,5 +43,5 @@ jobs:
- name: Install dependencies
run: yarn install

- name: Deploy to 0xgraph
run: ./bin/release.sh ${{ github.ref_name }} ${{ matrix.chain }} 0xgraph ${{ secrets.OXGRAPH_TOKEN }}
- name: Deploy to Goldsky
run: ./bin/release.sh ${{ github.ref_name }} ${{ matrix.chain }} goldsky ${{ secrets.GOLDSKY_TOKEN }}
14 changes: 2 additions & 12 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ function publish_goldsky {
function publish {
CHAIN=$1
PROVIDER=$2
SUBGRAPH=beefyfinance/lrt-$CHAIN
case $PROVIDER in
"0xgraph")
publish_0xgraph $SUBGRAPH
publish_0xgraph beefyfinance/lrt-$CHAIN
;;
"goldsky")
publish_goldsky $SUBGRAPH
publish_goldsky beefy-lrt-$CHAIN-dev
;;
esac
}
Expand All @@ -58,15 +57,6 @@ if [ -z "$chain" ]; then
echo "chain is required"
exit_help
fi
# deploy all chains
if [ "$chain" == "all" ]; then
shift
for chain in ${valid_chains[@]}; do
echo "==== deploying $chain: $0 $chain $@"
$0 $chain $@
done
exit 0
fi
if [[ ! " ${valid_chains[@]} " =~ " ${chain} " ]]; then
echo "invalid chain"
exit_help
Expand Down
8 changes: 4 additions & 4 deletions bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ function publish_goldsky {
VERSION=$2
DEPLOY_KEY=$3
echo "publishing $SUBGRAPH to goldsky"
goldsky subgraph deploy $SUBGRAPH/$VERSION --path .
goldsky subgraph deploy $SUBGRAPH/$VERSION --path . --token $DEPLOY_KEY
}

function publish {
VERSION=$1
CHAIN=$2
PROVIDER=$3
DEPLOY_KEY=$4
SUBGRAPH=beefyfinance/lrt-$CHAIN
SUBGRAPH=
case $PROVIDER in
"0xgraph")
publish_0xgraph $SUBGRAPH $VERSION $DEPLOY_KEY
publish_0xgraph beefyfinance/lrt-$CHAIN $VERSION $DEPLOY_KEY
;;
"goldsky")
publish_goldsky $SUBGRAPH $VERSION $DEPLOY_KEY
publish_goldsky beefy-lrt-$CHAIN $VERSION $DEPLOY_KEY
;;
esac
}
Expand Down

0 comments on commit f91a9d8

Please sign in to comment.