Skip to content

Commit 3e2c9c8

Browse files
authored
ci: deploy to netlify using github actions (#1818)
- deploy previews via github actions in 4 minutes instead of 8 - production build as well
1 parent 32c8593 commit 3e2c9c8

3 files changed

Lines changed: 93 additions & 1 deletion

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# .github/workflows/netlify.yml
2+
name: Netlify Deploy Preview
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
- 'examples'
8+
- '!examples/monaco-graphql-webpack'
9+
10+
jobs:
11+
build:
12+
name: "Build & Deploy"
13+
runs-on: ubuntu-18.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Yarn Install
19+
uses: bahmutov/npm-install@v1
20+
# ( Build to ./dist or other directory... )
21+
- name: Build
22+
run: yarn build
23+
24+
- name: Build Bundles
25+
run: yarn build-bundles
26+
27+
- name: Build Typedoc
28+
run: yarn build-docs
29+
30+
- name: Deploy Dev to Netlify
31+
uses: nwtgck/[email protected]
32+
with:
33+
publish-dir: './packages/graphiql/'
34+
production-branch: main
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
deploy-message: "Deploy Preview: ${{ github.event.pull_request.title }}. Use `/dev` for react debugging"
37+
enable-pull-request-comment: true
38+
enable-commit-comment: true
39+
overwrites-pull-request-comment: true
40+
functions-dir: functions
41+
github-deployment-environment: "Deploy Preview"
42+
env:
43+
NETLIFY_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
44+
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}
45+
timeout-minutes: 1

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# .github/workflows/netlify.yml
2+
name: Netlify Production Deploy
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'examples'
10+
- '!examples/monaco-graphql-webpack'
11+
12+
jobs:
13+
deploy:
14+
name: "Build & Deploy Production Demo & API Docs"
15+
runs-on: ubuntu-18.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Yarn Install
21+
uses: bahmutov/npm-install@v1
22+
# ( Build to ./dist or other directory... )
23+
24+
- name: Build
25+
run: yarn build
26+
27+
- name: Build Bundles
28+
run: yarn build-bundles
29+
30+
- name: Build Typedoc
31+
run: yarn build-docs
32+
33+
- name: Deploy Production Demo & Typedoc to Netlify
34+
uses: nwtgck/[email protected]
35+
with:
36+
publish-dir: './packages/graphiql/'
37+
production-branch: main
38+
production-deploy: true
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
deploy-message: "GraphiQL 1 Demo"
41+
functions-dir: functions
42+
github-deployment-environment: "GraphiQL 1 Demo"
43+
env:
44+
NETLIFY_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
45+
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}
46+
timeout-minutes: 1

.github/workflows/push-pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
- name: Yarn Install
4545
uses: bahmutov/npm-install@v1
4646

47-
- run: yarn test --coverage
47+
- name: Run Unit Tests
48+
run: yarn test --coverage
4849

4950
- name: Codecov
5051
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)