diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 000000000..dd9e25e10 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -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 diff --git a/.gitignore b/.gitignore index 146e44fc9..a7006f213 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ private # Build vendor build +docs/output docs/_build docs/tutorial docs/node_modules diff --git a/Makefile b/Makefile index 268b907ed..a29e5866d 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/output/.gitkeep b/docs/output/.gitkeep new file mode 100644 index 000000000..e69de29bb