diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..f80af1588 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,31 @@ +name: Documentation +# This job builds and deploys documenation to github pages. +# It runs on every push to master. +on: + push: + branches: + - master + +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 + + - name: Install and Build 🔧 + run: | + apk add rsync + make build-gh-docs + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: ~/output diff --git a/Makefile b/Makefile index 4feae921b..8789dc3b0 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ DESTINATION = ./index.html.md ############################################################################### ### Documentation ### ############################################################################### - +# todo remove once tendermint.com DNS is solved build-docs: @cd docs && \ while read -r branch path_prefix; do \ @@ -203,6 +203,17 @@ build-docs: done < versions ; .PHONY: build-docs +build-gh-docs: + @cd docs && \ + while read -r branch path_prefix; do \ + (git checkout $${branch} && npm install && VUEPRESS_BASE="/tendermint/$${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 + +# todo remove once tendermint.com DNS is solved sync-docs: cd ~/output && \ echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \