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

Create flow to update subgraph docs on Dev-Portal #557

Merged
merged 8 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
67 changes: 67 additions & 0 deletions .github/workflows/subgraph-documentation-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow is triggered when a pull request is closed on the 'develop' or 'main' branches
# and there is a change to the 'packages/subgraph/schema.graphql' file.

name: Subgraph Documentation Update

on:
workflow_dispatch:
pull_request:
types:
- closed
banasa44 marked this conversation as resolved.
Show resolved Hide resolved
branches:
- develop
- main
paths:
- 'packages/subgraph/schema.graphql'
- 'packages/subgraph/src/examples'
- '.github/workflows/subgraph-deploy.yaml'

jobs:
update_docs:
permissions: read-all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup nodejs
uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: 16
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate introspection query result
run: yarn generate:introspection
working-directory: packages/subgraph/
- name: Generate Query Examples docs
run: yarn docs:examples
working-directory: packages/subgraph/
- name: Checkout developer-portal
uses: actions/checkout@v4
with:
repository: aragon/developer-portal
ref: staging
path: developer-portal
token: ${{ secrets.ARABOT_PAT }}
- name: Remove the docs/subgraph folder in the developer-portal
run: rm -rf $GITHUB_WORKSPACE/developer-portal/docs/subgraph
- name: Copy the docs/developer-portal folder to the developer-portal
run: cp -R packages/subgraph/docs/developer-portal $GITHUB_WORKSPACE/developer-portal/docs/subgraph
- name: Copy the generated schema-introspection.json to the developer-portal
run: cp -R packages/subgraph/docs/schema-introspection.json $GITHUB_WORKSPACE/developer-portal/static/subgraph
- name: Get short commit hash
id: hash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.ARABOT_PAT }}
path: developer-portal
commit-message: 'Update the Aragon Subgraph docs by commit ${{ steps.hash.outputs.sha_short }}'
committer: 'Arabot <[email protected]>'
branch: patch/aragon-subgraph-docs
delete-branch: true
title: Update the Aragon Subgraph docs
body: 'Automated update by Github actions (Run: [${{ github.run_id }}](https://github.com/aragon/osx/actions/runs/${{ github.run_id }}))'
reviewers: ${{ github.actor }}
team-reviewers: Ara-Team-OSX
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ managementDAOTX.json
generated
subgraph.yaml
.bin
mythx.json
mythx.json

# docs
packages/subgraph/docs/developer-portal/01-query-examples/*
banasa44 marked this conversation as resolved.
Show resolved Hide resolved
!packages/subgraph/docs/developer-portal/01-query-examples/index.md
5 changes: 5 additions & 0 deletions packages/subgraph/docs/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
generates:
./schema-introspection.json:
schema: ../schema.graphql
plugins:
- introspection
banasa44 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Query Examples [WIP]
sidebar_label: Query Examples
---

## Querying in Subgraph

This section will contain useful queries.
19 changes: 19 additions & 0 deletions packages/subgraph/docs/developer-portal/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Aragon Subgraph [WIP]
sidebar_label: Introduction
sidebar_position: 0
---

## The On-Chain Information

Subgraph is a protocol for indexing and querying event data emitted from the smart contracts.

The Aragon Subgraph stores all DAO-related information, either to help users to manage and interact with their DAOs or to query useful information, such as its treasury information, members, plugins, etc.

## Playground

You can use the [Aragon subgraph-satsuma playground](https://subgraph.satsuma-prod.com/aragon/osx-mainnet/playground) for testing.

### Walkthrough

This documentation includes some [example queries](./01-query-examples/index.md) to get you familiarized with subgraph protocol and the [Reference Guide](./reference-guide/index.md) generated from the latest version of our `@aragon/osx` [subgraph schema](https://github.com/aragon/osx/blob/develop/packages/subgraph/schema.graphql).
Loading
Loading