ci: Add GitHub Actions for documentation deployment (#11540)

* Add GitHub Actions for documentation deployment

* Only update when docs change

* delete midnight build
This commit is contained in:
Julien Robert 2022-04-05 00:35:42 +02:00 committed by GitHub
parent 8b32094d1b
commit 2822f71b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 3 deletions

33
.github/workflows/deploy-docs.yml vendored Normal file
View File

@ -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/github-pages-deploy-action@v4.3.0
with:
branch: gh-pages
folder: docs/output
single-commit: true

1
.gitignore vendored
View File

@ -14,6 +14,7 @@ private
# Build
vendor
build
docs/output
docs/_build
docs/tutorial
docs/node_modules

View File

@ -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

0
docs/output/.gitkeep Normal file
View File