web/_scripts/travis/cibuild.sh

37 lines
724 B
Bash
Raw Normal View History

#!/bin/bash
# Travis CI build jobs.
#
# © 2019 Cotes Chung
# Published under MIT License
if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then # triggered by author
BUILDER=../blog-builder
git clone https://${GH_TOKEN}@github.com/cotes2020/blog-builder.git \
$BUILDER --depth=1 -q
cp -r $BUILDER/framework/* .
bash _cibuild.sh
else # triggered by Pull Request
2019-12-23 15:16:25 +03:00
SAFE_DOMAIN="cdn.jsdelivr.net"
2019-12-22 21:35:58 +03:00
python _scripts/py/init_all.py
2019-12-23 15:16:25 +03:00
build_cmd="bundle exec jekyll build"
echo "\$ $build_cmd"
eval $build_cmd
2019-12-23 15:16:25 +03:00
bundle exec htmlproofer _site/ \
--disable-external \
2019-12-22 21:35:58 +03:00
--check-html \
--empty_alt_ignore \
--allow_hash_href \
2019-12-23 15:16:25 +03:00
--url_ignore $SAFE_DOMAIN
2019-12-22 21:35:58 +03:00
fi