Skip to content

Commit ebc8cd3

Browse files
authored
chore: monaco example oauth (#1836)
also organize CI tests better, deploys for monaco
1 parent e3eac9d commit ebc8cd3

File tree

8 files changed

+288
-207
lines changed

8 files changed

+288
-207
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# .github/workflows/netlify.yml
2-
name: Netlify Deploy Preview
2+
name: Netlify Preview
33
on:
4-
push:
4+
pull_request:
5+
types: [opened, synchronize]
56
paths-ignore:
67
- '**.md'
78
- 'examples'
8-
- '!examples/monaco-graphql-webpack'
9-
pull_request:
10-
types: [opened, synchronize]
9+
- '!examples/monaco-graphql-webpack/**'
1110

1211
jobs:
13-
build:
14-
name: "Build & Deploy"
12+
graphiql-preview:
13+
name: "GraphiQL"
1514
runs-on: ubuntu-18.04
1615
steps:
1716
- name: Checkout
@@ -35,13 +34,45 @@ jobs:
3534
publish-dir: './packages/graphiql/'
3635
production-branch: main
3736
github-token: ${{ secrets.GITHUB_TOKEN }}
38-
deploy-message: "Deploy Preview: ${{ github.event.pull_request.title }}. Use `/dev` for react debugging"
37+
deploy-message: "GraphiQL 1 Preview"
3938
enable-pull-request-comment: true
4039
enable-commit-comment: true
4140
overwrites-pull-request-comment: true
4241
functions-dir: functions
43-
github-deployment-environment: "Deploy Preview"
42+
github-deployment-environment: "graphiql-1"
4443
env:
4544
NETLIFY_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
4645
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}
4746
timeout-minutes: 1
47+
monaco-preview:
48+
name: "Monaco GraphQL"
49+
runs-on: ubuntu-18.04
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
54+
- name: Yarn Install
55+
uses: bahmutov/npm-install@v1
56+
# ( Build to ./dist or other directory... )
57+
- name: Build
58+
run: yarn build
59+
60+
- name: Build Monaco Example
61+
run: yarn workspace example-monaco-graphql-webpack run build
62+
63+
- name: Deploy Monaco GraphQL Example to Netlify
64+
uses: nwtgck/[email protected]
65+
with:
66+
publish-dir: './examples/monaco-graphql-webpack/bundle'
67+
production-branch: main
68+
github-token: ${{ secrets.GITHUB_TOKEN }}
69+
deploy-message: "Monaco GraphQL Preview"
70+
enable-pull-request-comment: true
71+
enable-commit-comment: true
72+
overwrites-pull-request-comment: true
73+
functions-dir: functions
74+
github-deployment-environment: "monaco-graphql"
75+
env:
76+
NETLIFY_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
77+
NETLIFY_SITE_ID: 46a6b3c8-992f-4623-9a76-f1bd5d40505c
78+
timeout-minutes: 1

.github/workflows/deploy.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# .github/workflows/netlify.yml
2-
name: Netlify Production Deploy
2+
name: Netlify Production
33
on:
44
push:
55
branches:
66
- main
77
paths-ignore:
88
- '**.md'
99
- 'examples'
10-
- '!examples/monaco-graphql-webpack'
10+
- '!examples/monaco-graphql-webpack/**'
1111

1212
jobs:
1313
deploy:
14-
name: "Build & Deploy Production Demo & API Docs"
14+
name: "Build & Deploy GraphiQL 1 Demo & API Docs"
1515
runs-on: ubuntu-18.04
1616
steps:
1717
- name: Checkout
@@ -44,3 +44,31 @@ jobs:
4444
NETLIFY_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
4545
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}
4646
timeout-minutes: 1
47+
deploy-monaco:
48+
name: "Build & Deploy Monaco Example"
49+
runs-on: ubuntu-18.04
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
54+
- name: Yarn Install
55+
uses: bahmutov/npm-install@v1
56+
# ( Build to ./dist or other directory... )
57+
58+
- name: Build
59+
run: yarn build
60+
61+
- name: Deploy Monaco Demo to Netlify
62+
uses: nwtgck/[email protected]
63+
with:
64+
publish-dir: './packages/graphiql/'
65+
production-branch: main
66+
production-deploy: true
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
deploy-message: "Monaco Demo"
69+
functions-dir: functions
70+
github-deployment-environment: "Monaco Demo"
71+
env:
72+
NETLIFY_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
73+
NETLIFY_SITE_ID: 46a6b3c8-992f-4623-9a76-f1bd5d40505c
74+
timeout-minutes: 1

.github/workflows/pr-check.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint & Build PR
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
6+
jobs:
7+
lint:
8+
name: Lint
9+
runs-on: ubuntu-16.04
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v2
13+
14+
- name: Yarn Install
15+
uses: bahmutov/npm-install@v1
16+
17+
- name: Eslint
18+
run: yarn lint
19+
20+
- name: Prettier Check
21+
run: yarn pretty-check
22+
23+
build:
24+
name: Typescript Build
25+
runs-on: ubuntu-16.04
26+
steps:
27+
- name: Checkout Code
28+
uses: actions/checkout@v2
29+
30+
- name: Yarn Install
31+
uses: bahmutov/npm-install@v1
32+
33+
- name: Tyescript Build
34+
run: yarn build

.github/workflows/push-pr.yml renamed to .github/workflows/pr-tests.yml

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,12 @@
1-
name: CI
1+
name: Test PR
22
on:
33
pull_request:
44
types: [opened, synchronize]
5-
5+
paths-ignore:
6+
- '**.md'
7+
- 'examples'
8+
- '!examples/monaco-graphql-webpack'
69
jobs:
7-
lint:
8-
name: Lint
9-
runs-on: ubuntu-16.04
10-
steps:
11-
- name: Checkout Code
12-
uses: actions/checkout@v2
13-
14-
- name: Yarn Install
15-
uses: bahmutov/npm-install@v1
16-
17-
- name: Eslint
18-
run: yarn lint
19-
20-
- name: Prettier Check
21-
run: yarn pretty-check
22-
23-
build:
24-
name: Typescript Build
25-
runs-on: ubuntu-16.04
26-
steps:
27-
- name: Checkout Code
28-
uses: actions/checkout@v2
29-
30-
- name: Yarn Install
31-
uses: bahmutov/npm-install@v1
32-
33-
- name: Tyescript Build
34-
run: yarn build
35-
3610
unit:
3711
name: Unit Tests
3812
runs-on: ubuntu-16.04
@@ -46,6 +20,9 @@ jobs:
4620
- name: Yarn Install
4721
uses: bahmutov/npm-install@v1
4822

23+
- name: Build
24+
run: yarn build
25+
4926
- name: Run Unit Tests
5027
run: yarn test --coverage
5128

examples/monaco-graphql-webpack/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
"description": "A simple monaco example with webpack and typescript",
77
"scripts": {
88
"build": "cross-env NODE_ENV=production webpack-cli",
9-
"build-demo-main": "yarn build && yarn copy-demo",
10-
"copy-demo-main": "mkdirp ../../packages/graphiql/monaco && copy 'bundle/*' '../../packages/graphiql/monaco'",
119
"start": "cross-env NODE_ENV=development webpack-dev-server"
1210
},
1311
"dependencies": {
1412
"graphql": "experimental-stream-defer",
15-
"monaco-graphql": "0.4.2",
13+
"monaco-graphql": "^0.4.3",
1614
"prettier": "^2.0.4"
1715
},
1816
"devDependencies": {

examples/monaco-graphql-webpack/src/index.html.ejs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
/>
99
<title>Monaco Example!</title>
1010
<style>
11+
body {
12+
background-color: #1e1e1e;
13+
}
1114
.div {
1215
margin: 0;
1316
padding: 0;
@@ -21,28 +24,20 @@
2124
width: 50%;
2225
}
2326
#toolbar {
24-
flex:auto;
25-
flex-direction: row;
26-
align-items: end;
27-
display: flex;
28-
}
29-
input {
30-
display: flex;
31-
flex-direction: column;
32-
width: 80%;
27+
background-color: #1e1e1e;
28+
text-align: right;
3329
}
3430
#button {
35-
flex: auto;
36-
flex-direction: column;
37-
display: flex;
31+
padding: .5em 1em;
3832
}
3933
</style>
34+
<script src="https://unpkg.com/netlify-auth-providers"></script>
4035
</head>
4136

4237
<body style="margin: 0; padding: 0;">
4338
<div style="display: flex;">
4439
<div class="full-height column">
45-
<div id="toolbar" style=""></div>
40+
<div id="toolbar"></div>
4641
<div id="operation" style="height: 70vh;"></div>
4742
<div id="variables" style="height: 30vh;"></div>
4843
</div>

0 commit comments

Comments
 (0)