Skip to content

Commit

Permalink
Publish schema to apollo studio
Browse files Browse the repository at this point in the history
  • Loading branch information
garryod committed Mar 19, 2024
1 parent 715be1a commit 0dfe5a4
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Schema

on:
push:
pull_request:

jobs:
generate_publish:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/[email protected]

- name: Install stable toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
default: true

- name: Cache Rust Build
uses: Swatinem/[email protected]

- name: Generate Schema
uses: actions-rs/[email protected]
with:
command: run
args: >
schema
--path sessions.graphql
- name: Upload Schema Artifact
uses: actions/[email protected]
with:
name: sessions.graphql
path: sessions.graphql

- name: Check subgraph schema
uses: danielsinclair/[email protected]
with:
args: |
subgraph check data-gateway@current
--schema sessions.graphql
--name sessions
- name: Publish subgraph schema to Apollo Studio
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
uses: danielsinclair/[email protected]
with:
args: |
subgraph publish data-gateway@current
--routing-url http://sessions:80
--schema sessions.graphql
--name sessions

0 comments on commit 0dfe5a4

Please sign in to comment.