How would I got about calling a php file every time someone publishes a new post?

add_action('publish_post', 'call_my_php_file');
function call_my_php_file($post_id){
  require_once("path/to/file.php");
}

tech