Skip to content

Register to Vote πŸ‡ΊπŸ‡Έ

Setting Up Percy CI

I finally fixed my Percy CI configuration so that it has the pull request and branch contexts so that it can choose the correct base build to compare screenshots from.

Apparently I also needed to include a webhook to percy on my main builds and branch preview builds so that it could be aware of those as well.

I updated each build command in netlify.toml with

[context.deploy-preview]
command = "export PERCY_BRANCH=\"$BRANCH\";export PERCY_PULL_REQUEST=\"$REVIEW_ID\";hugo --buildFuture -b $DEPLOY_PRIME_URL && percy snapshot public/"

This set the correct environmental variables for percy and sent them to the service via percy snapshot public/.