-
Notifications
You must be signed in to change notification settings - Fork 44
57 lines (54 loc) · 1.95 KB
/
subgraph-deploy-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Subgraph Publish
on:
push:
branches: [ main ]
paths:
- "subgraphs/**"
workflow_dispatch: {}
jobs:
subgraph-publish:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- subgraph: "products"
routing_url: "http://products:4000/graphql"
rover-version: "latest"
- subgraph: "users"
routing_url: "http://users:4000/graphql"
rover-version: "latest"
- subgraph: "inventory"
routing_url: "http://inventory:4000/graphql"
rover-version: "latest"
env:
APOLLO_KEY: ${{ secrets.APOLLO_KEY }}
APOLLO_GRAPH_REF: supergraph-router@dev
name: ${{ matrix.subgraph }}
steps:
- uses: actions/checkout@v3
-
name: install rover
env:
ROVER_VERSION: ${{ matrix.rover-version }}
run: |
curl -sSL https://rover.apollo.dev/nix/$ROVER_VERSION | sh
echo "PATH=$PATH:$HOME/.rover/bin" >> ${GITHUB_ENV}
-
name: subgraph check
run: |
set -x
rover subgraph check $APOLLO_GRAPH_REF --schema subgraphs/${{ matrix.subgraph }}/${{ matrix.subgraph }}.graphql --name ${{ matrix.subgraph }}
-
name: "TODO: deploy your subgraph to dev"
run: |
echo "TODO: ADD YOUR DEPLOYMENT STEPS HERE"
echo "which should only complete when the new version of the subgraph is deployed"
echo "so the subgraph schema can be published AFTER the subgraph service is deployed"
echo ""
echo "see https://github.com/apollographql/supergraph-demo-k8s-graphops"
echo "for a more scalable way of doing this in a Kubernetes-native way."
-
name: subgraph publish
run: |
set -x
rover subgraph publish $APOLLO_GRAPH_REF --routing-url ${{ matrix.routing_url }} --schema subgraphs/${{ matrix.subgraph }}/${{ matrix.subgraph }}.graphql --name ${{ matrix.subgraph }}