2019-04-04 22:53:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -xe
|
|
|
|
|
|
|
|
# Install netlify-cli
|
2019-10-23 17:54:19 +00:00
|
|
|
npm install netlify-cli
|
|
|
|
|
|
|
|
# set path to grab the netlify binary
|
|
|
|
export PATH=$PATH:$(npm bin)
|
2019-04-04 22:53:30 +00:00
|
|
|
|
|
|
|
# Deploy site to netlify
|
|
|
|
# Assumes NETLIFY_SITE_ID and NETLIFY_AUTH_TOKEN env variables are set
|
2020-04-20 19:57:34 +00:00
|
|
|
output=$(netlify deploy --dir=./website/build --json)
|
2019-04-04 22:53:30 +00:00
|
|
|
|
|
|
|
# Grab deploy URL
|
2020-04-20 19:57:34 +00:00
|
|
|
url=$(echo "$output" | jq --raw-output '.deploy_url')
|
2019-04-04 22:53:30 +00:00
|
|
|
|
|
|
|
# Checks broken links
|
|
|
|
wget \
|
|
|
|
--delete-after \
|
|
|
|
--level inf \
|
|
|
|
--no-verbose \
|
|
|
|
--recursive \
|
|
|
|
--no-directories \
|
|
|
|
--no-host-directories \
|
|
|
|
--page-requisites \
|
|
|
|
--spider \
|
|
|
|
$url
|