Skip to content

Commit f6f7a8c

Browse files
authored
Merge pull request #1 from DaleStudy/ci-apollo
ci: add GitHub Actions workflows for Apollo Check and Apollo Publish
2 parents 1cd44ff + 0977121 commit f6f7a8c

File tree

4 files changed

+86
-58
lines changed

4 files changed

+86
-58
lines changed

.github/workflows/apollo-check.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Apollo Check
2+
on:
3+
pull_request:
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
env:
8+
APOLLO_VCS_BRANCH: ${{ github.head_ref }}
9+
APOLLO_VCS_COMMIT: ${{ github.event.pull_request.head.sha }}
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: apollographql-gh-actions/install-rover@v1
13+
- uses: apollographql-gh-actions/rover-subgraph-lint@v1
14+
with:
15+
apollo-key: ${{ secrets.APOLLO_KEY }}
16+
graph-ref: ${{ secrets.APOLLO_GRAPH_REF }}
17+
name: github
18+
schema: ./github.graphql
19+
- uses: apollographql-gh-actions/rover-subgraph-check@v1
20+
with:
21+
apollo-key: ${{ secrets.APOLLO_KEY }}
22+
graph-ref: ${{ secrets.APOLLO_GRAPH_REF }}
23+
name: github
24+
schema: ./github.graphql
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Apollo Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
environment: apollo
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: apollographql-gh-actions/install-rover@v1
13+
- uses: apollographql-gh-actions/rover-subgraph-publish@v1
14+
with:
15+
apollo-key: ${{ secrets.APOLLO_KEY }}
16+
graph-ref: ${{ secrets.APOLLO_GRAPH_REF }}
17+
name: github
18+
schema: ./github.graphql
19+
no-url: true

github.graphql

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
extend schema
2+
@link(url: "https://specs.apollo.dev/federation/v2.10", import: ["@key"])
3+
@link(
4+
url: "https://specs.apollo.dev/connect/v0.1"
5+
import: ["@connect", "@source"]
6+
)
7+
@source(
8+
name: "github"
9+
http: {
10+
baseURL: "https://api.github.com"
11+
headers: [
12+
{ name: "Accept", value: "application/vnd.github+json" }
13+
{ name: "User-Agent", value: "{$config.agent}" }
14+
{ name: "Authorization", value: "token {$config.token}" }
15+
]
16+
}
17+
)
18+
19+
type Query {
20+
"All trees in the leetcode-study repository"
21+
gitTrees: [GitTree]!
22+
@connect(
23+
source: "github"
24+
# https://docs.github.com/en/rest/git/trees#get-a-tree
25+
http: {
26+
GET: "/repos/DaleStudy/leetcode-study/git/trees/main?recursive=1"
27+
}
28+
selection: """
29+
$.tree {
30+
type
31+
path
32+
}
33+
"""
34+
)
35+
}
36+
37+
"A file or directory in the Git repository"
38+
type GitTree {
39+
"The type of the node"
40+
type: String!
41+
"The path of the node"
42+
path: String!
43+
}

products.graphql

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)