Skip to content

Commit

Permalink
build: deploy docs to GitHub Pages (#116)
Browse files Browse the repository at this point in the history
* build: deploy docs to GitHub Pages

* versioning

* try fix

* fix swagger docs

* fix docs build
  • Loading branch information
fedekunze committed Jun 12, 2021
1 parent 5fe785e commit f762087
Show file tree
Hide file tree
Showing 14 changed files with 24,523 additions and 992 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 17 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -25,20 +25,20 @@ 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 ChainSafe’s 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
community of your intentions to begin work. Ideally, wait for confirmation that no one has started it. However,
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`
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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**: ChainSafe’s Ethermint team currently cuts releases on a need to have basis. We will announce a more
**Note**: tharsis’s Ethermint team currently cuts releases on a need to have basis. We will announce a more
standardized release schedule as we near production readiness.
46 changes: 31 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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..."
Expand Down Expand Up @@ -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.
Expand All @@ -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 ###
Expand Down Expand Up @@ -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 ###
###############################################################################
Expand Down
3 changes: 3 additions & 0 deletions client/docs/statik/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package statik

// This just for fixing the error in importing empty github.com/tharsis/ethermint/client/docs/statik
9 changes: 5 additions & 4 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

53 changes: 20 additions & 33 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -105,35 +105,23 @@ 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: [{
title: 'Cosmos SDK Docs',
url: 'https://docs.cosmos.network'
},
{
title: 'Ethermint Docs',
title: 'Ethereum Docs',
url: 'https://ethereum.org/developers'
},
{
Expand All @@ -151,29 +139,28 @@ module.exports = {
{
title: 'Ethermint Forum',
url: 'https://forum.cosmos.network/c/ethermint'
},
{
title: 'ChainSafe Blog',
url: 'https://medium.com/chainsafe-systems'
}
]
},
{
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"
}
],
}
};
4 changes: 2 additions & 2 deletions docs/guides/join_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions docs/intro/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit f762087

Please sign in to comment.