Skip to content

Commit

Permalink
chore: remove docs build (#17791)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Sep 19, 2023
1 parent 1629312 commit 4ef0130
Show file tree
Hide file tree
Showing 182 changed files with 188 additions and 24,392 deletions.
8 changes: 0 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ updates:
interval: daily
time: "01:00"

- package-ecosystem: npm
directory: "/docs"
schedule:
interval: weekly
# DevRel should review docs updates
assignees:
- "julienrbrt"

- package-ecosystem: gomod
directory: "/"
schedule:
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/build-docs.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/deploy-docs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private

# Build
vendor
build
/build
dist
tools-stamp
buf-stamp
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ godocs:
go install golang.org/x/tools/cmd/godoc@latest
godoc -http=:6060

build-docs:
@cd docs && DOCS_DOMAIN=docs.cosmos.network sh ./build-all.sh

.PHONY: build-docs

###############################################################################
### Tests & Simulation ###
###############################################################################
Expand Down
46 changes: 11 additions & 35 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
# Dependencies
/node_modules

# Production
build
!docs/build

# Generated files
.docusaurus
.cache-loader
versioned_docs
versioned_sidebars
docs/node_modules
docs/docs/modules
docs/docs/spec
docs/docs/architecture
docs/docs/rfc
docs/docs/tooling/01-cosmovisor.md
docs/docs/tooling/02-confix.md
docs/docs/tooling/03-hubl.md
docs/docs/core/17-autocli.md
docs/docs/packages/01-depinject.md
docs/docs/packages/02-collections.md
docs/docs/packages/03-orm.md
docs/modules
docs/spec
docs/architecture
docs/rfc
docs/tooling/01-cosmovisor.md
docs/tooling/02-confix.md
docs/tooling/03-hubl.md
docs/core/17-autocli.md
docs/packages/01-depinject.md
docs/packages/02-collections.md
docs/packages/03-orm.md
docs/user/run-node/04-rosetta.md
docs/build/migrations/02-upgrading.md
docs/develop/advanced/17-autocli.md

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
83 changes: 4 additions & 79 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,7 @@
# Updating the docs

If you want to open a PR in Cosmos SDK to update the documentation, please follow the guidelines in [`CONTRIBUTING.md`](https://github.com/cosmos/cosmos-sdk/tree/main/CONTRIBUTING.md#updating-documentation) and the [Documentation Writing Guidelines](./DOC_WRITING_GUIDELINES.md).

## Stack

The documentation for Cosmos SDK is hosted at https://docs.cosmos.network and built from the files in the `/docs` directory.
It is built using the following stack:

* [Docusaurus 2](https://docusaurus.io)
* Vuepress (pre v0.47)
* [Algolia DocSearch](https://docsearch.algolia.com/)

```js
algolia: {
appId: "QLS2QSP47E",
apiKey: "067b84458bfa80c295e1d4f12c461911",
indexName: "cosmos_network",
contextualSearch: false,
},
```

* GitHub Pages

## Docs Build Workflow

The docs are built and deployed automatically on GitHub Pages by a [GitHub Action workflow](../.github/workflows/deploy-docs.yml).
The workflow is triggered on every push to the `main` and `release/v**` branches, every time documentations or specs are modified.

### How It Works

There is a GitHub Action listening for changes in the `/docs` directory for the `main` branch and each supported version branch (e.g. `release/v0.46.x`). Any updates to files in the `/docs` directory will automatically trigger a website deployment. Under the hood, the private website repository has a `make build-docs` target consumed by a Github Action within that repository.

## How to Build the Docs Locally

Go to the `docs` directory and run the following commands:

```shell
cd docs
npm install
```
::note
The documentation is built from [cosmos-sdk-docs repo](https://github.com/cosmos/cosmos-sdk-docs) and is hosted on [docs.cosmos.network](https://docs.cosmos.network).
:::

For starting only the current documentation, run:

```shell
npm start
```

It runs `pre.sh` scripts to get all the docs that are not already in the `docs/docs` folder.
It also runs `post.sh` scripts to clean up the docs and remove unnecessary files when quitting.

Note, the command above only build the docs for the current versions.
With the drawback that none of the redirections works. So, you'll need to go to /main to see the docs.

To build all the docs (including versioned documentation), run:

```shell
make build-docs
```

## What to for new major SDK versions

When a new major version of the SDK is released, the following steps should be taken:

* On the `release/vX.Y.Z` branch, remove the deploy action (`.github/workflows/deploy-docs.yml`), for avoiding deploying the docs from the release branches.
* On the `release/vX.Y.Z` branch, update `docusaurus.config.js` and set the `lastVersion` to `current`, remove all other versions from the config.
* Each time a new version is released (on docusaurus), drop support from the oldest versions.
* If the old version is still running vuepress (v0.45, v0.46), remove its line from `vuepress_versions`
* If any, remove the outdated redirections from `docusaurus.config.js` and add the base version redirection (`/vX.XX`) to `/main`.

```js
{
from: ["/", "/master", "/v0.43", "/v0.44", "/v0.XX"], // here add the deprecated version
to: "/main",
},
```

* Add the new version sidebar to the list of versionned sidebar and add the version to `versions.json`.
* Update the latest version (`presets[1].docs.lastVersion`) in `docusaurus.config.js`.
* Add the new version with in `presets[1].docs.versions` in `docusaurus.config.js`.

Learn more about [versioning](https://docusaurus.io/docs/versioning) in Docusaurus.
If you want to open a PR in Cosmos SDK to update the documentation, please follow the guidelines in [`CONTRIBUTING.md`](https://github.com/cosmos/cosmos-sdk/tree/main/CONTRIBUTING.md#updating-documentation) and the [Documentation Writing Guidelines](./DOC_WRITING_GUIDELINES.md).
3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

29 changes: 0 additions & 29 deletions docs/build-all.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4ef0130

Please sign in to comment.