Skip to content

Instantly share code, notes, and snippets.

@alexlouden
Last active February 26, 2019 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexlouden/34a5f826a3fac2b242b9c1e035d82992 to your computer and use it in GitHub Desktop.
Save alexlouden/34a5f826a3fac2b242b9c1e035d82992 to your computer and use it in GitHub Desktop.
Check Gastby site for broken links using CircleCI
version: 2
jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/node:10
steps:
- checkout
- run:
name: install-yarn
command: yarn install --quiet
- run:
name: install-testing-utils
command: yarn global add alexlouden/broken-link-checker --quiet
- run:
name: build
command: yarn build
- run:
name: serve
command: yarn serve
background: true
- run:
name: install dockerize
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
environment:
DOCKERIZE_VERSION: v0.3.0
- run:
name: Wait for serve
command: dockerize -wait tcp://localhost:9000 -timeout 5m
- run:
name: test
command: yarn blc -q -r -o http://localhost:9000/
{
"name": "your_gastby_project",
"scripts": {
"build": "gatsby build",
"dev": "gatsby develop",
"serve": "gatsby serve",
"blc": "blc",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment