When the project requires for open publishing and long term preservation
Key steps:
Have a list of data types and resources that need to be published and preserved (it might be the case that not everything needs to be published publicly).
Use an external trusted repository for your community/domain specific data such as GBIF, Genbank and BOLD. Or Zenodo, Figshare for generic data. These resources provide DOIs and structured metadata that are both human and machine readable.
Check if aggregators like GBIF are useful for your datasets.
Check long term preservation policies. Do you have requirements and guidelines for long term data preservation and archiving?
Besides data, what else needs to be preserved (software, lab protocols, algorithms, notebooks?).
Think about data compression challenges. Do you need to compress data before sharing and preserving?