deploy.sh 527 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. [ -z "${BOT_TOKEN}" ] && { echo "no token detected"; exit 1; }
  3. git clone https://${BOT_TOKEN}@codeberg.org/ForgeFed/pages.git /tmp/pages
  4. rm -fr /tmp/pages/*
  5. cp -rva public/* /tmp/pages
  6. cd /tmp/pages
  7. cat > .domains <<EOF
  8. forgefed.org
  9. www.forgefed.org
  10. EOF
  11. git add .
  12. if git diff --staged --exit-code >& /dev/null ; then
  13. echo No changes to push
  14. else
  15. git config user.email forgefedbot@forgefed.org
  16. git config user.name 'ForgeFedBot'
  17. git commit -m 'Update from deploy.sh'
  18. git push -u origin main
  19. fi