Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated package.json to test gh-workflow #100

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
68ef7b1
updated package.json to test gh-workflow
sharathkrml Oct 23, 2023
822034e
Update push-subgraph.yml - updating branch
estfe Oct 24, 2023
ef5513d
Update push-subgraph.yml
estfe Oct 24, 2023
aff019e
Update push-subgraph.yml - listing folders
estfe Oct 24, 2023
4426313
Update push-subgraph.yml
estfe Oct 24, 2023
9d6dc0c
Update push-subgraph.yml - testing github operations
estfe Oct 24, 2023
ceb27a2
Update push-subgraph.yml - echo folder
estfe Oct 24, 2023
3972332
Update push-subgraph.yml - fix typo
estfe Oct 24, 2023
0933089
Update push-subgraph.yml - removing cd folder
estfe Oct 24, 2023
42b83ff
Update push-subgraph.yml - install graph cli
estfe Oct 24, 2023
db3607f
Update push-subgraph.yml - removing typo
estfe Oct 24, 2023
6e6ff3f
Update push-subgraph.yml - fixing headers
estfe Oct 24, 2023
973d90f
Update push-subgraph.yml
estfe Oct 24, 2023
c6dde03
Update create-subgraph.yml
estfe Oct 24, 2023
47a7248
Update create-subgraph.yml
estfe Oct 24, 2023
5118f47
Update push-subgraph.yml
estfe Oct 24, 2023
0221dd0
Update push-subgraph.yml - passing labels
estfe Oct 26, 2023
e2f9698
Update push-subgraph.yml - testing output echo
estfe Oct 26, 2023
4ee7faa
Update push-subgraph.yml - testing echo
estfe Oct 26, 2023
63c992b
Update push-subgraph.yml - correcting identation
estfe Oct 26, 2023
cc50eef
Update push-subgraph.yml - labeling
estfe Oct 26, 2023
b903b4f
Update create-subgraph.yml
estfe Oct 26, 2023
e9d0ba9
Update create-subgraph.yml - spliting runners by env
estfe Oct 26, 2023
a8535be
Update create-subgraph.yml - testing labels
estfe Oct 26, 2023
b7bf4a1
Update create-subgraph.yml
estfe Oct 26, 2023
82c5768
Update push-subgraph.yml
estfe Oct 26, 2023
6c73cf8
Update push-subgraph.yml
estfe Oct 26, 2023
40a92cc
Update push-subgraph.yml
estfe Oct 26, 2023
aedafbd
Update push-subgraph.yml
estfe Oct 26, 2023
4423701
Update push-subgraph.yml
estfe Oct 26, 2023
02a5968
Update create-subgraph.yml
estfe Oct 26, 2023
84edf3c
Update push-subgraph.yml
estfe Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/create-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,41 @@ on:
required: true
type: string
jobs:
build:
create-subgraph:
environment: development
runs on: self-hosted
runs-on:
- self-hosted
- ${{ (github.event.inputs.environment == 'development' && 'subgraphs-dev') || (github.event.inputs.environment == 'production' && 'subgraphs-prod') }}
steps:
- uses: actions/checkout@v3

- name: Set up Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install Yarn
run: |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install -y yarn

- name: Install graph-cli
run: |
sudo yarn global add @graphprotocol/graph-cli

- name: Install yq
run: |
sudo add-apt-repository ppa:rmescandon/yq
sudo apt update
sudo apt install yq -y
yq --version

- name: Read sub.folder.name from folder.yaml and create subgraph
- name: Create subgraph based on environment
run: |
if [ "${{ github.event.inputs.environment }}" == "development" ]; then
NODE_URL="$DEV_NODE_URL"
else
NODE_URL="$PROD_NODE_URL"
fi
echo $NODE_URL
echo $SUBGRAPH_NAME
graph create --node $NODE_URL $SUBGRAPH_NAME
env:
DEV_NODE_URL: ${{ secrets.DEV_NODE_URL }}
PROD_NODE_URL: ${{ secrets.PROD_NODE_URL }}
SUBGRAPH_NAME: ${{ github.events.inputs.subgraph_name }}

SUBGRAPH_NAME: ${{ github.event.inputs.subgraph_name }}
63 changes: 40 additions & 23 deletions .github/workflows/push-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,51 +38,68 @@ on:
jobs:
build:
environment: development
runs on: self-hosted
runs-on:
- self-hosted
- ${{ (github.event.inputs.environment == 'development' && 'subgraphs-dev') || (github.event.inputs.environment == 'production' && 'subgraphs-prod') }}
steps:
- uses: actions/checkout@v3

- name: Install yq
- name: Set up Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install Yarn
run: |
sudo add-apt-repository ppa:rmescandon/yq
sudo apt update
sudo apt install yq -y
yq --version
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install -y yarn

- name: Read sub.folder.name from folder.yaml and run npm
- name: Install graph-cli
run: |
sudo yarn global add @graphprotocol/graph-cli

- name: Run npm
working-directory: ${{ github.event.inputs.folder }}
run: |
cd $FOLDER_NAME
echo $FOLDER_NAME
echo $SUBGRAPH_NAME
npm i
npm run codegen
npm run build
npm run deploy


- name: Read sub.folder.name from folder.yaml and run graph deploy on public IPFS node
- name: Run graph deploy on public IPFS node
working-directory: ${{ github.event.inputs.folder }}
run: |
if [ "${{ github.event.inputs.environment }}" == "development" ]; then
NODE_URL="$DEV_NODE_URL"
else
NODE_URL="$PROD_NODE_URL"
fi
graph deploy --node $NODE_URL --ipfs $IPFS_PUBLIC_NODE $SUBGRAPH_NAME

- name: Read sub.folder.name from folder.yaml and run graph deploy on public Infura node
echo $IPFS_PUBLIC_NODE
echo $SUBGRAPH_NAME
graph deploy --node $NODE_URL --ipfs $IPFS_PUBLIC_NODE --version-label v0.0.1 $SUBGRAPH_NAME

- name: Run graph deploy on public Infura node
working-directory: ${{ github.event.inputs.folder }}
run: |
if [ "${{ github.event.inputs.environment }}" == "development" ]; then
NODE_URL="$DEV_NODE_URL"
else
NODE_URL="$PROD_NODE_URL"
fi
graph deploy --node $NODE_URL --ipfs $IPFS_INFURA_NODE ---headers '{\"Authorization\": \"Basic $INFURA_HASH\"}' $SUBGRAPH_NAME
graph deploy --node $NODE_URL --ipfs $IPFS_INFURA_NODE --headers '{"Authorization": "Basic '$INFURA_HASH'"}' --version-label v0.0.1 $SUBGRAPH_NAME
echo $SUBGRAPH_NAME

env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
SUBGRAPH_NAME: ${{ github.event.inputs.subgraph_name }}
FOLDER_NAME: ${{ github.event.inputs.folder }}
DEV_NODE_URL: ${{ secrets.DEV_NODE_URL }}
PROD_NODE_URL: ${{ secrets.PROD_NODE_URL }}
INFURA_HASH: ${{ secrets.INFURA_AUTH_HEADERS }}
IPFS_PUBLIC_NODE: ${{ secrets.IPFS_PUBLIC_NODE }}
IPFS_INFURA_NODE: ${{ secrets.IPFS_INFURA_NODE }}

env:
ENVIRONMENT: ${{ github.event.inputs.environment }}
SUBGRAPH_NAME: ${{ github.events.inputs.subgraph_name }}
FOLDER_NAME: ${{ github.events.inputs.folder }}
DEV_NODE_URL: ${{ secrets.DEV_NODE_URL }}
PROD_NODE_URL: ${{ secrets.PROD_NODE_URL }}
INFURA_HASH: ${{ secrets.INFURA_AUTH_HEADERS }}
IPFS_PUBLIC_NODE: ${{ secrets.IPFS_PUBLIC_NODE }}
IPFS_INFURA_NODE: ${{ secrets.IPFS_INFURA_NODE }}

Loading
Loading