I usually handle this with save_post action.
// We'll use 1000, low priority (we'll let other hooks to run first)
add_action( 'save_post', [$this, 'jackie_publish_post_hook'], 1000, 3 );
Then within your class:
function jackie_publish_post_hook( $post_id, $post, $update ) {
if ( $update ) return false; // Post already existed, don't proceed
// Do stuff
}
Or use a post meta:
function jackie_publish_post_hook( $post_id, $post, $update ) {
if ( get_post_meta( $post_id, 'jackie_post_processed', true ) != '' ) return false;
update_post_meta( $post_id, 'jackie_post_processed', 1 );
// Do stuff
}