build: deploy docs to GitHub Pages (#116)

* build: deploy docs to GitHub Pages

* versioning

* try fix

* fix swagger docs

* fix docs build
This commit is contained in:
Federico Kunze 2021-06-12 12:27:10 -04:00 committed by GitHub
parent 5fe785e917
commit f762087d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 24466 additions and 935 deletions

34
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Documentation
# This job builds and deploys documenation to github pages.
# It runs on every push to main.
on:
push:
branches:
- main
schedule:
- cron: "* 0 * * *"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: tendermintdev/docker-website-deployment
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
with:
persist-credentials: false
fetch-depth: 0
repository: "tharsis/ethermint"
- name: Install and Build 🔧
run: |
apk add rsync
make build-docs LEDGER_ENABLED=false
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: ~/output

View File

@ -9,11 +9,11 @@
* [Testing](#testing)
* [Updating Documentation](#updating_doc)
* [Branching Model and Release](#braching_model_and_release)
* [PR Targeting](#pr_targeting)
* [Pull Requests](#pull_requests)
* [Process for reviewing PRs](#reviewing_prs)
* [Pull Merge Procedure](#pull_merge_procedure)
* [Release Procedure](#release_procedure)
* [PR Targeting](#pr_targeting)
* [Pull Requests](#pull_requests)
* [Process for reviewing PRs](#reviewing_prs)
* [Pull Merge Procedure](#pull_merge_procedure)
* [Release Procedure](#release_procedure)
## <span id="general_procedure">General Procedure</span>
@ -25,12 +25,12 @@ workflow and standards.
Contributing to this repo can mean many things such as participating in discussion or proposing code changes. To ensure
a smooth workflow for all contributors, the following general procedure for contributing has been established:
1. Either [open](https://github.com/cosmos/cosmos-sdk/issues/new/choose)
or [find](https://github.com/cosmos/cosmos-sdk/issues) an issue you have identified and would like to contribute to
1. Either [open](https://github.com/cosmos/ethermint/issues/new/choose)
or [find](https://github.com/cosmos/ethermint/issues) an issue you have identified and would like to contribute to
resolving.
2. Participate in thoughtful discussion on that issue.
3. If you would like to contribute:
1. If the issue is a proposal, ensure that the proposal has been accepted by ChainSafes Ethermint team.
1. If the issue is a proposal, ensure that the proposal has been accepted by the Ethermint team.
2. Ensure that nobody else has already begun working on the same issue. If someone already has, please make sure to
contact the individual to collaborate.
3. If nobody has been assigned the issue and you would like to work on it, make a comment on the issue to inform the
@ -38,7 +38,7 @@ a smooth workflow for all contributors, the following general procedure for cont
if you are eager and do not get a prompt response, feel free to dive on in!
4. Follow standard Github best practices:
1. Fork the repo
2. Branch from the HEAD of `development`(For core developers working within the cosmos-sdk repo, to ensure a
2. Branch from the HEAD of `development`(For core developers working within the ethermint repo, to ensure a
clear ownership of branches, branches must be named with the convention `{moniker}/{issue#}-branch-name`).
3. Make commits
4. Submit a PR to `development`
@ -70,19 +70,19 @@ to [Tendermint ADRs](https://github.com/tendermint/tendermint/tree/master/docs/a
## <span id="forking">Forking</span>
Please note that Go requires code to live under absolute paths, which complicates forking. While my fork lives
at `https://github.com/chainsafe/cosmos-sdk`, the code should never exist
at `$GOPATH/src/github.com/chainsafe/cosmos-sdk`. Instead, we use `git remote` to add the fork as a new remote for the
original repo,`$GOPATH/src/github.com/cosmos/cosmos-sdk`, and do all the work there.
at `https://github.com/tharsis/ethermint`, the code should never exist
at `$GOPATH/src/github.com/tharsis/ethermint`. Instead, we use `git remote` to add the fork as a new remote for the
original repo,`$GOPATH/src/github.com/cosmos/ethermint`, and do all the work there.
For instance, to create a fork and work on a branch of it, you would:
1. Create the fork on github, using the fork button.
2. Go to the original repo checked out locally. (i.e. `$GOPATH/src/github.com/cosmos/cosmos-sdk`)
2. Go to the original repo checked out locally. (i.e. `$GOPATH/src/github.com/cosmos/ethermint`)
3. `git remote rename origin upstream`
4. `git remote add origin git@github.com:chainsafe/cosmos-sdk.git`
4. `git remote add origin git@github.com:tharsis/ethermint.git`
Now `origin` refers to my fork and `upstream` refers to the Cosmos-SDK version. So I can `git push -u origin master` to
update my fork, and make pull requests to Cosmos-SDK from there. Of course, replace `chainsafe` with your git handle.
Now `origin` refers to my fork and `upstream` refers to the ethermint version. So I can `git push -u origin master` to
update my fork, and make pull requests to ethermint from there. Of course, replace `tharsis` with your git handle.
To pull in updates from the origin repo, run:
@ -215,5 +215,5 @@ All PRs require two Reviews before merge. When reviewing PRs, please use the fol
8. Tag the release (use `git tag -a`) and create a release in Github.
9. Delete the `RC` branches.
**Note**: ChainSafes Ethermint team currently cuts releases on a need to have basis. We will announce a more
**Note**: tharsiss Ethermint team currently cuts releases on a need to have basis. We will announce a more
standardized release schedule as we near production readiness.

View File

@ -172,6 +172,7 @@ docker-localnet:
###############################################################################
TOOLS_DESTDIR ?= $(GOPATH)/bin
STATIK = $(TOOLS_DESTDIR)/statik
RUNSIM = $(TOOLS_DESTDIR)/runsim
# Install the runsim binary with a temporary workaround of entering an outside
@ -184,6 +185,11 @@ $(RUNSIM):
@echo "Installing runsim..."
@(cd /tmp && ${GO_MOD} go get github.com/cosmos/tools/cmd/runsim@master)
statik: $(STATIK)
$(STATIK):
@echo "Installing statik..."
@(cd /tmp && go get github.com/rakyll/statik@v0.1.6)
contract-tools:
ifeq (, $(shell which stringer))
@echo "Installing stringer..."
@ -237,7 +243,7 @@ else
endif
tools: tools-stamp
tools-stamp: contract-tools docs-tools proto-tools runsim
tools-stamp: contract-tools docs-tools proto-tools statik runsim
# Create dummy file to satisfy dependency and avoid
# rebuilding when this Makefile target is hit twice
# in a row.
@ -253,7 +259,7 @@ docs-tools-stamp: docs-tools
# in a row.
touch $@
.PHONY: runsim tools contract-tools docs-tools proto-tools tools-stamp tools-clean docs-tools-stamp
.PHONY: runsim statik tools contract-tools docs-tools proto-tools tools-stamp tools-clean docs-tools-stamp
###############################################################################
### Tests & Simulation ###
@ -413,23 +419,33 @@ proto-update-deps:
### Documentation ###
###############################################################################
# Start docs site at localhost:8080
docs-serve:
@cd docs && \
yarn install && \
yarn run serve
# Build the site into docs/.vuepress/dist
docs-build:
@$(MAKE) docs-tools-stamp && \
cd docs && \
yarn install && \
yarn run build
update-swagger-docs: statik
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m
@if [ -n "$(git status --porcelain)" ]; then \
echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
exit 1;\
else \
echo "\033[92mSwagger docs are in sync\033[0m";\
fi
.PHONY: update-swagger-docs
godocs:
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/cosmos/ethermint"
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/tharsis/ethermint/types"
godoc -http=:6060
# This builds a docs site for each branch/tag in `./docs/versions`
# and copies each site to a version prefixed path. The last entry inside
# the `versions` file will be the default root index.html.
build-docs:
@cd docs && \
while read -r branch path_prefix; do \
(git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \
mkdir -p ~/output/$${path_prefix} ; \
cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \
cp ~/output/$${path_prefix}/index.html ~/output ; \
done < versions ;
.PHONY: build-docs
###############################################################################
### Localnet ###
###############################################################################

View File

@ -0,0 +1,3 @@
package statik
// This just for fixing the error in importing empty github.com/tharsis/ethermint/client/docs/statik

File diff suppressed because one or more lines are too long

View File

@ -8,9 +8,9 @@ module.exports = {
},
base: process.env.VUEPRESS_BASE || '/',
themeConfig: {
repo: 'cosmos/ethermint',
docsRepo: 'cosmos/ethermint',
docsBranch: 'development',
repo: 'tharsis/ethermint',
docsRepo: 'tharsis/ethermint',
docsBranch: 'main',
docsDir: 'docs',
editLinks: true,
custom: true,
@ -67,7 +67,7 @@ module.exports = {
title: 'Resources',
children: [{
title: 'Ethermint API Reference',
path: 'https://godoc.org/github.com/cosmos/ethermint'
path: 'https://godoc.org/github.com/tharsis/ethermint'
},
{
title: 'Cosmos REST API Spec',
@ -105,27 +105,15 @@ module.exports = {
footer: {
logo: '/logo-bw.svg',
textLink: {
text: 'ethermint.zone',
url: 'https://ethermint.zone'
text: 'tharsis.finance/ethermint',
url: 'https://tharsis.finance/ethermint'
},
services: [{
service: 'github',
url: 'https://github.com/cosmos/ethermint'
},
{
service: 'twitter',
url: 'https://twitter.com/chainsafeth'
},
{
service: 'linkedin',
url: 'https://www.linkedin.com/company/chainsafe-systems'
},
{
service: 'medium',
url: 'https://medium.com/chainsafe-systems'
},
url: 'https://github.com/tharsis/ethermint'
}
],
smallprint: 'This website is maintained by [ChainSafe Systems](https://chainsafe.io). The contents and opinions of this website are those of ChainSafe Systems.',
smallprint: 'This website is maintained by Tharsis.',
links: [{
title: 'Documentation',
children: [{
@ -133,7 +121,7 @@ module.exports = {
url: 'https://docs.cosmos.network'
},
{
title: 'Ethermint Docs',
title: 'Ethereum Docs',
url: 'https://ethereum.org/developers'
},
{
@ -151,10 +139,6 @@ module.exports = {
{
title: 'Ethermint Forum',
url: 'https://forum.cosmos.network/c/ethermint'
},
{
title: 'ChainSafe Blog',
url: 'https://medium.com/chainsafe-systems'
}
]
},
@ -162,18 +146,21 @@ module.exports = {
title: 'Contributing',
children: [{
title: 'Contributing to the docs',
url: 'https://github.com/cosmos/ethermint/tree/development/docs'
url: 'https://github.com/tharsis/ethermint/tree/development/docs'
},
{
title: 'Careers at ChainSafe',
url: 'https://chainsafe.io/#careers'
}, {
title: 'Source code on GitHub',
url: 'https://github.com/cosmos/ethermint/blob/development/docs/DOCS_README.md'
url: 'https://github.com/tharsis/ethermint/blob/development/docs/DOCS_README.md'
}
]
}
]
}
},
},
versions: [
{
"label": "main",
"key": "main"
}
],
}
};

View File

@ -2,9 +2,9 @@
order: 5
-->
# Joining Chainsafe's Public Testnet
# JoiningTestnet
This document outlines the steps to join the public testnet hosted by [Chainsafe](https://chainsafe.io).
This document outlines the steps to join the public testnet
## Steps

View File

@ -36,10 +36,6 @@ Note: most of these articles are outdated as they refer to the previous Ethermin
- [Introducing the Hard Spoon - Chjango Unchained](https://blog.cosmos.network/introducing-the-hard-spoon-4a9288d3f0df)
- [Ethermint and NFTs at EthDenver - Tendermint](https://blog.cosmos.network/ethermint-nfts-at-ethdenver-bf32766835b6)
### ChainSafe Blog
- [ChainSafe Awarded Second Ethermint Grant](https://medium.com/chainsafe-systems/chainsafe-awarded-second-ethermint-grant-f65930309cae)
## Previous Ethermint implementations
- [Ethermint ABCI:](https://github.com/cosmos/ethermint_abci) This project was the first and original Tendermint ABCI application with EVM support. Not built with Cosmos SDK.

23391
docs/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,10 @@
"main": "index.js",
"scripts": {
"preserve": "./pre.sh",
"serve": "trap 'exit 0' SIGINT; vuepress dev --no-cache",
"serve": "vuepress dev",
"build": "vuepress build",
"postserve": "./post.sh",
"prebuild": "./pre.sh",
"build": "trap 'exit 0' SIGINT; vuepress build --no-cache",
"postbuild": "./post.sh"
},
"keywords": [
@ -18,11 +18,12 @@
"blockchain",
"cryptocurrency"
],
"author": "ChainSafe Systems",
"author": "Tharsis",
"license": "ISC",
"dependencies": {
"entities": "^2.0.3",
"vuepress-theme-cosmos": "^1.0.172"
"markdown-it": "^12.0.6",
"vuepress-theme-cosmos": "^1.0.182"
},
"devDependencies": {
"watchpack": "^1.7.2"

View File

@ -9,4 +9,4 @@ for D in ../x/*; do
fi
done
cat ../x/README.md | sed 's/\.\/x/\/x/g' | sed 's/spec\/README.md//g'
cat ../x/README.md | sed 's/\.\/x/\/modules/g' | sed 's/spec\/README.md//g' | sed 's/\.\.\/docs\/building-modules\/README\.md/\/building-modules\/intro\.html/g' > ./modules/README.md

View File

@ -115,7 +115,7 @@ The command above command will run containers in the background using Docker co
```bash
...
Creating network "chainsafe-ethermint_localnet" with driver "bridge"
Creating network "ethermint_localnet" with driver "bridge"
Creating ethermintdnode0 ... done
Creating ethermintdnode2 ... done
Creating ethermintdnode1 ... done

1
docs/versions Normal file
View File

@ -0,0 +1 @@
main main

File diff suppressed because it is too large Load Diff