add link checking to CI and split website build/deploy

This commit is contained in:
Alvin Huang 2019-04-04 18:54:47 -04:00
parent 68b2b6eede
commit 5cc7a96641
1 changed files with 36 additions and 1 deletions

View File

@ -182,10 +182,39 @@ jobs:
name: middleman build name: middleman build
command: bundle exec middleman build command: bundle exec middleman build
# saves website build directory
- persist_to_workspace:
root: .
paths:
- build
deploy-website:
# setting the working_directory along with the checkout path allows us to not have
# to cd into the website/ directory for commands
working_directory: ~/project/website
docker:
- image: *MIDDLEMAN_IMAGE
steps:
- checkout:
path: ~/project
# attach website build directory
- attach_workspace:
at: ~/project/website
- run: - run:
name: website deploy name: website deploy
command: ./scripts/deploy.sh command: ./scripts/deploy.sh
# Link check on a temporary netlify deployed site
docs-link-checker:
docker:
- image: circleci/node:lts
steps:
- checkout
# attach website build directory
- attach_workspace:
at: ~/project/website
- run: ./website/scripts/link-check.sh
# build frontend yarn cache # build frontend yarn cache
frontend-cache: frontend-cache:
docker: docker:
@ -267,7 +296,13 @@ workflows:
- dev-build - dev-build
website: website:
jobs: jobs:
- build-website: - build-website
- docs-link-checker:
requires:
- build-website
- deploy-website:
requires:
- docs-link-checker
context: static-sites context: static-sites
filters: filters:
branches: branches: