Skip to content

Instantly share code, notes, and snippets.

@noir-neo
Last active March 22, 2019 14:25
Show Gist options
  • Select an option

  • Save noir-neo/3a2071dc6d8ea8300caed4bc2bb2de26 to your computer and use it in GitHub Desktop.

Select an option

Save noir-neo/3a2071dc6d8ea8300caed4bc2bb2de26 to your computer and use it in GitHub Desktop.
download zip and deploy to gh-pages
#!/bin/bash
set -eu
if [ $# -ne 2 ]; then
exit 1
fi
wget $1 -O tmp.zip
unzip tmp.zip
unzip -qql tmp.zip | head -n1 | tr -s ' ' | cut -d' ' -f5- | sed -e 's/\/.*//g' | sed -e 's/ /\\ /g' | xargs -I '{}' mv {} tmp
pushd tmp
git init
git remote add origin $2
git checkout -b gh-pages
git add -A
git commit -m deploy
git push -f origin gh-pages
popd
rm -rf tmp.zip tmp
@noir-neo
Copy link
Author

./deploy-zip-to-gh-pages.sh "path/to/your.zip" git@github.com:your/repository.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment