-
Notifications
You must be signed in to change notification settings - Fork 679
/
build.sh
executable file
·27 lines (22 loc) · 1016 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# This builds the docs.cosmos.network docs using docusaurus.
# Old documentation, is not migrated, but is still available at the appropriate release tag.
# Get the current commit hash, usually should be main.
COMMIT=$(git rev-parse HEAD)
mkdir -p ~/versioned_docs ~/versioned_sidebars
# Build docs for each version tag in versions.json.
for version in $(jq -r .[] versions.json); do
echo ">> Building docusaurus $version docs"
(git clean -fdx && git reset --hard && git checkout $version && npm install && npm run docusaurus docs:version $version)
mv ./versioned_docs/* ~/versioned_docs/
mv ./versioned_sidebars/* ~/versioned_sidebars/
echo ">> Finished building docusaurus $version docs"
done
# Build docs for $COMMIT that we started on.
echo ">> Building docusaurus main docs"
(git clean -fdx && git reset --hard && git checkout $COMMIT)
mv ~/versioned_docs ~/versioned_sidebars .
npm ci && npm run build
mv build ~/output
echo ">> Finished building docusaurus main docs"
exit 0