Last active
February 26, 2019 12:54
-
-
Save alexlouden/34a5f826a3fac2b242b9c1e035d82992 to your computer and use it in GitHub Desktop.
Check Gastby site for broken links using CircleCI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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