diff --git a/.circleci/config.yml b/.circleci/config.yml index 56f32f37..a365e7d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -313,7 +313,11 @@ jobs: paths: - ~/.cache/yarn - run: + name: Build package docs command: yarn docs + - run: + name: Copy docs into deployment folder + command: ./scripts/docs/copy_docs.sh lint: docker: - image: circleci/node:10-buster diff --git a/.gitignore b/.gitignore index 9c2099af..22fef9b7 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ node_modules/ # Code coverage .nyc_output/ coverage/ + +# Documentation builds +/docs_deployment/ diff --git a/scripts/docs/copy_docs.sh b/scripts/docs/copy_docs.sh new file mode 100755 index 00000000..29f02437 --- /dev/null +++ b/scripts/docs/copy_docs.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail +command -v shellcheck > /dev/null && shellcheck "$0" + +version="latest" +out_dir="./docs_deployment" +assets_dir="$out_dir/assets" +index="$out_dir/index.html" + +[ -d "$out_dir" ] && rm -r "$out_dir" +mkdir -p "$out_dir" + +# assets +mkdir -p "$assets_dir" +cp docs/cosmjs-tree.png "$assets_dir" + +{ + echo '

CosmJS documentation

' + echo '

CosmJS is a modular library consisting of multiple packages that are organized like this:

' + echo '

CosmJS dependency graph

' + echo '

Package documentation

' + echo '

The following packages can be used as libraries.

' + echo '' + echo '
' + echo '' +} >> "$index"