docs: deploy to github pages (#8321)
This commit is contained in:
parent
eafd1bc945
commit
df7f0b2741
@ -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.*/
|
||||
31
.github/workflows/docs.yml
vendored
Normal file
31
.github/workflows/docs.yml
vendored
Normal file
@ -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-docs LEDGER_ENABLED=false
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@3.7.1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: ~/output
|
||||
9
Makefile
9
Makefile
@ -201,14 +201,7 @@ build-docs:
|
||||
cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \
|
||||
cp ~/output/$${path_prefix}/index.html ~/output ; \
|
||||
done < versions ;
|
||||
|
||||
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
|
||||
.PHONY: build-docs
|
||||
|
||||
###############################################################################
|
||||
### Tests & Simulation ###
|
||||
|
||||
Loading…
Reference in New Issue
Block a user