From e26cf526841907291755a8a35fb6722a8ffeaaae Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 13 Jan 2021 10:45:45 +0100 Subject: [PATCH 1/6] migrate to github pages --- .circleci/config.yml | 64 -------------------------------------- .github/workflows/docs.yml | 32 +++++++++++++++++++ Makefile | 1 + 3 files changed, 33 insertions(+), 64 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/docs.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 099db02d8a33..000000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,64 +0,0 @@ -version: 2.1 - -executors: - docs: - docker: - - image: tendermintdev/docker-website-deployment - environment: - AWS_REGION: us-east-1 - -commands: - make: - parameters: - description: - type: string - target: - type: string - steps: - - attach_workspace: - at: /tmp/workspace - - restore_cache: - name: "Restore source code cache" - keys: - - go-src-v1-{{ .Revision }} - - checkout - - restore_cache: - name: "Restore go modules cache" - keys: - - go-mod-v2-{{ checksum "go.sum" }} - - run: - name: << parameters.description >> - command: | - make << parameters.target >> - -jobs: - build-docs: - executor: docs - steps: - - checkout - - run: - name: "Build docs" - command: make build-docs LEDGER_ENABLED=false - - run: - name: "Upload docs to S3" - command: make sync-docs LEDGER_ENABLED=false - -workflows: - version: 2 - test-suite: - jobs: - - build-docs: - context: docs-deployment-master - filters: - branches: - only: - - docs-staging - - build-docs: - context: docs-deployment-release - filters: - branches: - only: - - master - tags: - only: - - /v.*/ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000000..f2d9f365a78c --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +name: Documentation +# This job builds and deploys documenation to github pages. +# It runs on every push to master. +on: + pull_request: + 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-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 d72d69f20d2d..8a59fab67ed8 100644 --- a/Makefile +++ b/Makefile @@ -201,6 +201,7 @@ build-docs: cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \ cp ~/output/$${path_prefix}/index.html ~/output ; \ done < versions ; +.PHONY: build-docs sync-docs: cd ~/output && \ From dd8ba98ce349ac41387799b1325fa192157976ce Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 13 Jan 2021 10:50:21 +0100 Subject: [PATCH 2/6] disable ledger --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f2d9f365a78c..2d8eed799728 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: - name: Install and Build 🔧 run: | apk add rsync - make build-docs + make build-docs LEDGER_ENABLED=false - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@3.7.1 From 37b135c8f535d72e4b9b124a09d1be0dd291eaf5 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 13 Jan 2021 12:30:46 +0100 Subject: [PATCH 3/6] add cosmos-sdk --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8a59fab67ed8..408ac560896d 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,7 @@ godocs: build-docs: @cd docs && \ while read -r branch path_prefix; do \ - (git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \ + (git checkout $${branch} && npm install && VUEPRESS_BASE="/cosmos-sdk/$${path_prefix}/" npm run build) ; \ mkdir -p ~/output/$${path_prefix} ; \ cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \ cp ~/output/$${path_prefix}/index.html ~/output ; \ From 66931bd47cd17b21d8b4357cab82f7a2cea9884a Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 13 Jan 2021 12:42:18 +0100 Subject: [PATCH 4/6] remove sync docs --- Makefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Makefile b/Makefile index 408ac560896d..5b1762986062 100644 --- a/Makefile +++ b/Makefile @@ -203,14 +203,6 @@ build-docs: done < versions ; .PHONY: build-docs -sync-docs: - cd ~/output && \ - echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \ - echo "CI job = ${CIRCLE_BUILD_URL}" >> version.html ; \ - aws s3 sync . s3://${WEBSITE_BUCKET} --profile terraform --delete ; \ - aws cloudfront create-invalidation --distribution-id ${CF_DISTRIBUTION_ID} --profile terraform --path "/*" ; -.PHONY: sync-docs - ############################################################################### ### Tests & Simulation ### ############################################################################### From 98a636bc13b67ad8edb1d7851a54abc13b1583ee Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 13 Jan 2021 12:42:41 +0100 Subject: [PATCH 5/6] only run on master --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2d8eed799728..9c8fc8fbae0c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,7 +2,6 @@ name: Documentation # This job builds and deploys documenation to github pages. # It runs on every push to master. on: - pull_request: push: branches: - master From a753164d29607588f4f7e4d688a23592565f3115 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Wed, 13 Jan 2021 16:02:42 +0100 Subject: [PATCH 6/6] rmeove prefix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5b1762986062..6f498b36b3c6 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,7 @@ godocs: build-docs: @cd docs && \ while read -r branch path_prefix; do \ - (git checkout $${branch} && npm install && VUEPRESS_BASE="/cosmos-sdk/$${path_prefix}/" npm run build) ; \ + (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 ; \