Skip to content

Commit

Permalink
feat: add ci to dpeloy on the hosted service
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-devatom committed Jan 18, 2024
1 parent dc3a1a6 commit ce397a2
Show file tree
Hide file tree
Showing 4 changed files with 787 additions and 693 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: morpho-blue-subgraph

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
builds:
name: Build of Morpho Blue Subgraph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Generate types
run: yarn codegen

- name: Build subgraph
run: yarn build

deployment:
name: Deploy to TheGraph hosted service
environment:
name: Hosted Service
url: https://thegraph.com/hosted-service/subgraph/morpho-association/morpho-blue
needs: builds
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Generate types
run: yarn codegen

- name: Deploy to the hosted service
run: yarn graph auth --product hosted-service ${{ secrets.HOSTED_SERVICE_KEY }} && yarn deploy:hs

release:
name: Create new release
runs-on: ubuntu-latest
needs: deployment
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Publish release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.0
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@graphprotocol/graph-ts": "0.30.0"
},
"devDependencies": {
"@types/node": "^20.11.5",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
Expand Down
Loading

0 comments on commit ce397a2

Please sign in to comment.