mirror of
https://github.com/public-apis/public-apis.git
synced 2024-07-07 13:32:22 +02:00
Set Travis to deploy new JSON onto master
This commit is contained in:
parent
b0ef43db58
commit
4e2df625d3
@ -8,5 +8,6 @@ script:
|
||||
after_script:
|
||||
- cd build
|
||||
- sh build.sh
|
||||
- sh deploy.sh
|
||||
notifications:
|
||||
email: false
|
||||
|
30
build/deploy.sh
Normal file
30
build/deploy.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit -o nounset
|
||||
|
||||
if [ "$TRAVIS_BRANCH" != "master" ]
|
||||
then
|
||||
echo "This commit was made against $TRAVIS_BRANCH and not master! No deploy!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
rev=$(git rev-parse --short HEAD)
|
||||
|
||||
mkdir deploy
|
||||
cd deploy
|
||||
|
||||
git init
|
||||
git config user.name "Travis CI"
|
||||
git config user.email "build@travis.org"
|
||||
|
||||
git remote add upstream "https://$GH_TOKEN@github.com/davemachado/public-apis.git"
|
||||
git fetch upstream
|
||||
git reset upstream/master
|
||||
|
||||
mv ../json/*
|
||||
touch .
|
||||
|
||||
git add -A .
|
||||
git commit -m "rebuild JSON at ${rev}"
|
||||
git push upstream HEAD:master
|
||||
|
Loading…
Reference in New Issue
Block a user