vercel.sh 512 B

1234567891011121314151617
  1. #!/bin/bash
  2. # Check if there are changes in the docs directory
  3. git diff --quiet HEAD^ HEAD -- ../docs/
  4. has_docs_changes=$?
  5. echo ">> Docs diff status $has_docs_changes"
  6. # Deploy if:
  7. # 1. It's the master branch (production deployment), OR
  8. # 2. There are changes in the docs directory (preview deployment)
  9. if [[ $VERCEL_GIT_COMMIT_REF == "master" ]] || [ $has_docs_changes == 1 ]; then
  10. echo ">> Proceeding with deployment."
  11. exit 1;
  12. else
  13. echo ">> Skipping deployment (no docs changes detected)."
  14. exit 0;
  15. fi