ent/docs: circleci docs deployment

Summary: keeping docs in sync with entgo.io

Reviewed By: a8m

Differential Revision: D16937603

fbshipit-source-id: 1e07111c3db77ed49a768fc1d369a5ca6df5810e
This commit is contained in:
Alex Snast
2019-08-21 07:52:08 -07:00
committed by Facebook Github Bot
parent c55b8b6901
commit 8b345d94bb

View File

@@ -1,4 +1,9 @@
version: 2.1
orbs:
compare-url: iynere/compare-url@1.2.0
aws-cli: circleci/aws-cli@0.1.13
jobs:
unit:
docker:
@@ -36,6 +41,33 @@ jobs:
command: |
cd entc/integration/compose
docker-compose run test go test ./entc/integration/...
docs:
docker:
- image: circleci/node
steps:
- checkout
- compare-url/reconstruct
- compare-url/use:
step-name: Checking Docs Modified
custom-logic: |
if [[ ! $(git diff $COMMIT_RANGE --name-only doc/ ]]; then
echo "docs not modified; no need to deploy"
circleci step halt
fi
- run:
name: Install Dependencies
working_directory: ~/project/doc/website
command: yarn
- run:
name: Build Docs
working_directory: ~/project/doc/website
command: yarn build
- aws-cli/install
- aws-cli/configure
- run:
name: Deploy Docs
working_directory: ~/project/doc/website/build/ent
command: aws s3 sync . s3://entgo.io --delete --exclude "assets/*"
workflows:
version: 2.1
@@ -45,3 +77,9 @@ workflows:
- integration:
requires:
- unit
- docs:
requires:
- integration
filters:
branches:
only: master