Skip to content

Commit 79d1ef8

Browse files
committed
feat: Test Zeit docs deployment on circleci
1 parent a5dd5a5 commit 79d1ef8

File tree

3 files changed

+57
-17
lines changed

3 files changed

+57
-17
lines changed

.circleci/config.yml

+47-16
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
# Download and cache dependencies
1414
- restore_cache:
1515
keys:
16-
- v1-dependencies-{{ checksum "package-lock.json" }}
17-
# fallback to using the latest cache if no exact match is found
18-
- v1-dependencies-
16+
- v1-dependencies-{{ checksum "package-lock.json" }}
17+
# fallback to using the latest cache if no exact match is found
18+
- v1-dependencies-
1919
- run: npm install
2020
- save_cache:
2121
paths:
@@ -32,12 +32,12 @@ jobs:
3232
working_directory: ~/repo
3333
steps:
3434
- checkout
35-
# Download and cache dependencies
35+
# Download and cache dependencies
3636
- restore_cache:
3737
keys:
38-
- v1-dependencies-{{ checksum "package-lock.json" }}
39-
# fallback to using the latest cache if no exact match is found
40-
- v1-dependencies-
38+
- v1-dependencies-{{ checksum "package-lock.json" }}
39+
# fallback to using the latest cache if no exact match is found
40+
- v1-dependencies-
4141
- run: npm install
4242
- run:
4343
name: Build
@@ -49,6 +49,27 @@ jobs:
4949
- node_modules
5050
- package.json
5151

52+
deploy-docs:
53+
docker:
54+
- image: circleci/node:9
55+
working_directory: ~/repo
56+
steps:
57+
- checkout
58+
- restore_cache:
59+
keys:
60+
- v1-source-{{ checksum "package-lock.json" }}
61+
# fallback to using the latest cache if no exact match is found
62+
- v1-source-
63+
- run:
64+
name: Build Docs
65+
command: npm run docs
66+
- run:
67+
name: Deploy Docs to Zeit
68+
command: npm run docs
69+
- run:
70+
name: Aliasing Deployment
71+
command: npm run alias
72+
5273
publish-job:
5374
docker:
5475
- image: circleci/node:9
@@ -57,9 +78,9 @@ jobs:
5778
- checkout
5879
- restore_cache:
5980
keys:
60-
- v1-source-{{ checksum "package-lock.json" }}
61-
# fallback to using the latest cache if no exact match is found
62-
- v1-source-
81+
- v1-source-{{ checksum "package-lock.json" }}
82+
# fallback to using the latest cache if no exact match is found
83+
- v1-source-
6384
- run:
6485
name: Publish Package
6586
command: cd dist && npm run semantic-release
@@ -69,13 +90,23 @@ workflows:
6990
test:
7091
jobs:
7192
- test-job
72-
- build-job:
93+
- build-job
94+
# filters:
95+
# branches:
96+
# only:
97+
# - master
98+
- deploy-docs:
99+
requires:
100+
- test-job
101+
- build-job
102+
# filters:
103+
# branches:
104+
# only:
105+
# - master
106+
- publish-job:
107+
requires:
108+
- deploy-docs
73109
filters:
74110
branches:
75111
only:
76112
- master
77-
- publish-job:
78-
requires:
79-
- test-job
80-
- build-job
81-

package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"clean": "npm cache clear && rimraf -- dist",
1515
"test": "karma start",
1616
"semantic-release": "semantic-release",
17-
"docs": "typedoc"
17+
"docs": "typedoc",
18+
"docs:deploy": "now ./docs/typedoc -A ../now.json --public --token $NOW_TOKEN",
19+
"docs:deploy:alias": "now alias --token $NOW_TOKEN"
1820
},
1921
"author": {
2022
"name": "Yann Renaudin",
@@ -50,6 +52,7 @@
5052
"karma-sourcemap-loader": "^0.3.7",
5153
"karma-spec-reporter": "0.0.32",
5254
"karma-webpack": "^3.0.0",
55+
"now": "^11.4.1",
5356
"rimraf": "^2.6.1",
5457
"semantic-release": "^15.8.1",
5558
"source-map-loader": "^0.2.1",

0 commit comments

Comments
 (0)