heissepreise/pages.sh

27 lines
486 B
Bash
Raw Normal View History

2023-05-28 09:53:19 +02:00
#!/bin/bash
2023-05-28 11:26:17 +02:00
repository_name=${GITHUB_REPOSITORY#*/}
if [[ $repository_name == *.github.io ]]; then
echo "Name ends with github.io"
else
echo "Name does not end with github.io, not generating pages"
exit
2023-05-28 09:53:19 +02:00
fi
rm -rf tmp-data
mkdir tmp-data
2023-05-28 11:26:17 +02:00
mkdir -p docs
cp docs/latest-canonical.json tmp-data
2023-05-28 09:53:19 +02:00
npm install
2023-05-28 11:26:17 +02:00
node pages.js tmp-data
cp tmp-data/latest-canonical.json docs
2023-05-28 09:53:19 +02:00
2023-05-28 11:26:17 +02:00
cp site/* docs
2023-05-28 09:53:19 +02:00
pushd pages
git add *
git commit -am "Updated $(date +'%Y-%m-%d')"
git push
popd
rm -rf tmp-data