Skip to content

Commit 0125072

Browse files
authored
Merge pull request #335 from proto-kit/feature/cli-graphql-docs
Feature/cli graphql docs
2 parents 324ba85 + e5b2356 commit 0125072

File tree

12 files changed

+4963
-6686
lines changed

12 files changed

+4963
-6686
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Generate & Deploy GraphQL Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
jobs:
8+
generate-docs:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
cache: npm
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build packages
25+
run: npm run build
26+
27+
- name: Generate SpectaQL documentation
28+
run: npx @proto-kit/cli generate-gql-docs -e
29+
30+
- name: Upload docs as artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: graphql-docs
34+
path: gqlDocs
35+
36+
deploy:
37+
needs: generate-docs
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: write
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
46+
- name: Download generated docs
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: graphql-docs
50+
path: ./public
51+
52+
- name: Set pages URL
53+
id: vars
54+
run: |
55+
repo="${GITHUB_REPOSITORY}"
56+
pages_url="https://${GITHUB_REPOSITORY_OWNER}.github.io/${repo##*/}"
57+
echo "pages_url=${pages_url}" >> $GITHUB_OUTPUT
58+
59+
- name: Deploy develop branch
60+
uses: peaceiris/actions-gh-pages@v3
61+
with:
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
publish_dir: ./public
64+
keep_files: true
65+
66+
- name: Show deployment URL
67+
run: |
68+
echo "GraphQL docs deployed for 'develop':"
69+
echo "${{ steps.vars.outputs.pages_url }}"

0 commit comments

Comments
 (0)