A circle CI configuration to build a site with Hugo, test with html-proofer and then take screenshot tests via Percy.
This file contains 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: | |
hugo/build: | |
docker: | |
- image: cibuilds/hugo:0.55.6 | |
steps: | |
- checkout | |
- run: | |
name: Checkout Submodules if Needed | |
command: | | |
if [ -f ".gitmodules" ]; then | |
git submodule sync | |
git submodule update --init --recursive | |
fi | |
- run: | |
name: Build with Hugo | |
command: HUGO_ENV=production hugo --gc --minify -v -s . -d public -D -F | |
- run: | |
name: Test generated website with HTML Proofer. | |
command: htmlproofer ./public --allow-hash-href --check-html --empty-alt-ignore | |
--disable-external | |
- persist_to_workspace: | |
root: . | |
paths: | |
- public | |
snapshot: | |
docker: | |
- image: buildkite/puppeteer:v1.15.0 | |
steps: | |
- attach_workspace: | |
at: . | |
- run: | |
name: Install Percy | |
command: npm install percy | |
- run: | |
name: Capture Snapshots | |
command: PERCY_TOKEN=$PERCY_TOKEN npx percy snapshot ./public -i 'categories/!(coding|coding/**)/*.html','tags/!(amsterdam|amsterdam/**)/*.html','blog/page/!(1|2)/*.html' | |
workflows: | |
main: | |
jobs: | |
- hugo/build | |
- snapshot: | |
requires: | |
- hugo/build | |
version: 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment