Skip to content

Commit

Permalink
ci: Add GitHub Actions for documentation deployment (cosmos#11540)
Browse files Browse the repository at this point in the history
* Add GitHub Actions for documentation deployment

* Only update when docs change

* delete midnight build
  • Loading branch information
julienrbrt authored Apr 4, 2022
1 parent 8b32094 commit 2822f71
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy Documentation
# This job builds and deploys documenation to github pages.
# It runs on every push to master with a change in the docs folder.
on:
push:
branches:
- master
paths:
- "docs/**"

jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: tendermintdev/docker-website-deployment
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: Install and Build 🔧
run: |
apk add rsync
make build-docs LEDGER_ENABLED=false
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/output
single-commit: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ private
# Build
vendor
build
docs/output
docs/_build
docs/tutorial
docs/node_modules
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ build-docs:
while read -r branch path_prefix; do \
echo "building branch $${branch}" ; \
(git clean -fdx && git reset --hard && 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 ; \
mkdir -p output/$${path_prefix} ; \
cp -r .vuepress/dist/* output/$${path_prefix}/ ; \
cp output/$${path_prefix}/index.html output ; \
done < versions ;

.PHONY: build-docs
Expand Down
Empty file added docs/output/.gitkeep
Empty file.

0 comments on commit 2822f71

Please sign in to comment.