Skip to content

Commit

Permalink
feat: publish API docs on each release (#5)
Browse files Browse the repository at this point in the history
* remove docs folder in source

* add typedoc and gh-pages dev modules

* add documentation staging in CI config

* ci: fix errors

* fix(ci): fix submodules not pulled in fork repo

* ci: generate API docs only on tag release
  • Loading branch information
ParkourKarthik authored and DrSensor committed Oct 19, 2018
1 parent 4ead947 commit e866dbb
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 13 deletions.
48 changes: 44 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# @prettier
version: 2

install_submodule: &install_submodule
who_am_i: &who_am_i
run:
name: Prepare example repo
name: Tell the CI who I am
command: |
git config --global user.email $GIT_EMAIL
git config --global user.name $GIT_USERNAME
install_submodule: &install_submodule
run:
name: Prepare example repo
command: |
git submodule sync --recursive
git submodule update --init --recursive
unit_tests: &unit_tests
steps:
- checkout
- <<: *who_am_i
- <<: *install_submodule
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
Expand Down Expand Up @@ -69,6 +75,7 @@ jobs:
- image: circleci/node:8
steps:
- checkout
- <<: *who_am_i
- <<: *install_submodule
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
Expand Down Expand Up @@ -98,6 +105,26 @@ jobs:
<<: *unit_tests
#endregion

#region DOCUMENTATION
document:
docker:
- image: circleci/node:latest
steps:
- checkout
- <<: *who_am_i
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: NPM Rebuild
command: npm install --quiet
- run:
name: Generate Typedoc documentations
command: npm run ci:typedoc
- run:
name: Push the documentations to Github gh-pages
command: npm run ci:push-docs
#endregion

#region RELEASE VERSION
draft:
docker:
Expand Down Expand Up @@ -131,7 +158,7 @@ jobs:
- run:
name: Publish to NPM
command: npm publish --verbose
#endregion
#endregion

workflows:
version: 2
Expand Down Expand Up @@ -173,6 +200,19 @@ workflows:
only: /.*/
#endregion

#region DOCUMENTATION [just temporary test]
- document:
requires:
# - node6-latest
- node8-latest
- node10-latest
filters:
tags:
only: /^v\d+[.]\d+[.]\d+$/
branches:
ignore: /.*/
#endregion

#region RELEASE VERSION
- draft:
requires:
Expand All @@ -197,4 +237,4 @@ workflows:
filters:
tags:
only: /^v\d+[.]\d+[.]\d+$/
#endregion
#endregion
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.NOTE.md
!packages/*
types/
docs/
fgit

# Rust
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

[submodule "example"]
path = example
url = ../example-git-notes
url = ../../DrSensor/example-git-notes
Empty file removed docs/.gitkeep
Empty file.
Loading

0 comments on commit e866dbb

Please sign in to comment.